← Back to context

Comment by _delirium

15 years ago

Interesting idea I hadn't seen before. It's basically bucket sort, but using the scheduler to hold the bins.

Correcting myself: while that's what I think of it conceptually (everything is placed into integer-valued "bins" via the integer parameter taken by sleep()), implementation-wise it's probably equivalent to heapsort or something similar, depending on whether the scheduler stores sleeping threads in a heap or some other data structure.