3 ms·
This is basically an ICMP-based version of sleep sort: https://rosettacode.org/wiki/Sorting_algorithms/Sleep_sort https://rosettacode.org/wiki/Sorting_algorithm
by gregschlom 7y ago
This is basically an ICMP-based version of sleep sort: https://rosettacode.org/wiki/Sorting_algorithms/Sleep_sort https://rosettacode.org/wiki/Sorting_algorithms/Sleep_sort
- throwaway777555 7y agoThey'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.
- perl4ever 7y ago"Once COUNTER reaches 1000000, you have all of the values stored in the incessant stream of ICMP requests" This sounds to me like... https://en.wikipedia.org/wiki/Delay_line_memory https://en.wikipedia.org/wiki/Delay_line_memory
- jfitzsimons 7y agoIt's complicated by the fact that ICMP packets do not necessarily arrive in order.