Searched hist:137277 (Results 1 - 1 of 1) sorted by relevance
/freebsd-10.1-release/sys/kern/ | ||
H A D | subr_sleepqueue.c | diff 137277 Fri Nov 05 18:19:58 MST 2004 jhb - Store threads on sleep queues in FIFO order rather than sorted by priority. The sleep queues don't get updated when the priority of threads changes, so sleepq_signal() might not always wakeup the highest priority thread. Updating the queues when thread priorities change cannot be easily done due to lock orders, so instead we do an O(n) walk of the queue for a sleepq_signal() operation instead of O(1). On the other hand, adding a thread to a sleep queue now goes from O(n) to O(1) so it ends up as an even tradeoff. The correctness here with regards to priorities is actually fairly important. msleep() gives interactive threads their priority "boost" after they are placed on the queue, but before this fix that "boost" wasn't used to determine the highest priority thread that sleepq_signal() awoke. - Fix up some comments. Inspired by: ups, bde |
Completed in 148 milliseconds