Commit c235004
genwait: Keep queues in order by thread priority.
Currently, new waiting threads are always added to the end
of their genwait tailq and the first thread in the tailq is
the first woken. This means that unless a thread is being woken
and readded (like can happen with a `genwait_wake_all`) they will
always be awoken based on how long they have been waiting.
The downside to this method is that it ignores thread priorities,
which should be the controlling factor in which thread gets woken
first. By inserting into the queue by priority order, wakes will now
happen based on priority rather than time waiting.
The mild overhead of seeking through the waiting queues should be
outweighed greatly by allowing priority management via thread priorities.1 parent 05037cc commit c235004
1 file changed
Lines changed: 12 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | | - | |
| 72 | + | |
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
| |||
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
98 | | - | |
99 | | - | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
100 | 109 | | |
101 | 110 | | |
102 | 111 | | |
| |||
0 commit comments