Re:Sorting 1M 8-digit numbers in 1 MB of RAM (2012)
by gregschlom on Sunday March 29, 2020 @04:42PM
(#22722521)
This is basically an ICMP-based version of sleep sort: https://rosettacode.org/wiki/Sorting_algorithms/Sleep_sort
[ Parent
| on HN ]
Re:Sorting 1M 8-digit numbers in 1 MB of RAM (2012)
by throwaway777555 on Sunday March 29, 2020 @05:50PM
(#22723088)
They're both similar and very clever, but they do operate differently. Sleep sort works by setting up a delay and callback based on the values that you are sorting, so timing is crucial. The solution in this topic is using the network as a queue to store values and is constantly throwing them back, only pulling them into the sorted stack when they reach the max threshold. Once an item is pulled down, its value is recorded and isn't echoed out again. The process is repeated until the list is complete. This works without regard to timing.
Re:Sorting 1M 8-digit numbers in 1 MB of RAM (2012)
by perl4ever on Sunday March 29, 2020 @05:50PM
(#22723090)
"Once COUNTER reaches 1000000, you have all of the values stored in the incessant stream of ICMP requests"
This sounds to me like...
Re:Sorting 1M 8-digit numbers in 1 MB of RAM (2012)
by jfitzsimons on Monday March 30, 2020 @05:12AM
(#22726349)
It's complicated by the fact that ICMP packets do not necessarily arrive in order.