119,21 → 119,20 |
preemption and thread migration during times when preemption is |
possible.</para> |
|
<para> |
<mediaobject id="thread_states" xreflabel=""> |
<figure> |
<title>Transitions among thread states.</title> |
|
<mediaobject id="thread_states" xreflabel=""> |
<imageobject role="html"> |
<imagedata fileref="images/thread_states.png" format="PNG" /> |
</imageobject> |
|
<imageobject role="fop"> |
<imagedata fileref="images.vector/thread_states.svg" format="SVG" /> |
</imageobject> |
|
<caption>Transitions among thread states.</caption> |
</mediaobject> |
</para> |
|
<imagedata fileref="images/thread_states.png" format="PNG" /> |
</imageobject> |
|
<imageobject role="fop"> |
<imagedata fileref="images.vector/thread_states.svg" format="SVG" /> |
</imageobject> |
</mediaobject> |
</figure> |
|
<para>HelenOS userspace layer knows even smaller units of execution. Each |
userspace thread can make use of an arbitrary number of pseudo threads. |
These pseudo threads have their own synchronous register context, |
190,7 → 189,7 |
essential. If the processor kept running using the stack of the |
preempted thread it could damage it because the old thread can be |
migrated to another processor and scheduled there. In the worst case |
scenario, two execution flows would be using the same stack. </para> |
scenario, two execution flows would be using the same stack.</para> |
|
<para>The scheduling policy is implemented in function |
<code>find_best_thread</code>. This function walks the processor run |