79823936

Date: 2025-11-18 23:08:38
Score: 1
Natty:
Report link

It is on the order of the sorting algorithm used by the scheduler for the wait queue, and that doesn’t scale well for larger lists. It likely uses the timer_list structure, which is a linked list, and implements as an insertion sort, which is O(n^2).

For what it is worth, sleep only guarantees to the sleeping process that it will wake up after the deadline has expired. There is no guarantee of order of awakening. Other activity (virtual memory paging) could also impact the output order if the delays are in too small of an increment.

Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • Low reputation (1):
Posted by: Keith Boone