Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: