Rev 142 | Rev 169 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 142 | Rev 159 | ||
|---|---|---|---|
| Line 220... | Line 220... | ||
| 220 | preempted thread it could damage it because the old thread can be |
220 | preempted thread it could damage it because the old thread can be |
| 221 | migrated to another processor and scheduled there. In the worst case |
221 | migrated to another processor and scheduled there. In the worst case |
| 222 | scenario, two execution flows would be using the same stack.</para> |
222 | scenario, two execution flows would be using the same stack.</para> |
| 223 | 223 | ||
| 224 | <para>The scheduling policy is implemented in the function |
224 | <para>The scheduling policy is implemented in the function |
| 225 | <code>find_best_thread</code>. This function walks the processor run |
225 | <code>find_best_thread()</code>. This function walks the processor run |
| 226 | queues from lower towards higher indices and looks for a thread. If the |
226 | queues from lower towards higher indices and looks for a thread. If the |
| 227 | visited run queue is empty, it simply searches the next run queue. If it |
227 | visited run queue is empty, it simply searches the next run queue. If it |
| 228 | is known in advance that there are no ready threads waiting for |
228 | is known in advance that there are no ready threads waiting for |
| 229 | execution, <code>find_best_thread()</code> interruptibly halts the |
229 | execution, <code>find_best_thread()</code> interruptibly halts the |
| 230 | processor or busy waits until some threads arrive. This process repeats |
230 | processor or busy waits until some threads arrive. This process repeats |