Rev 169 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 169 | Rev 171 | ||
|---|---|---|---|
| Line 137... | Line 137... | ||
| 137 | <constant>Sleeping</constant> state by going to sleep or enters the |
137 | <constant>Sleeping</constant> state by going to sleep or enters the |
| 138 | <constant>Exiting</constant> state when it reaches termination. When the |
138 | <constant>Exiting</constant> state when it reaches termination. When the |
| 139 | thread exits, its kernel structure usually stays in memory, until the |
139 | thread exits, its kernel structure usually stays in memory, until the |
| 140 | thread is detached by another thread using <code>thread_detach()</code> |
140 | thread is detached by another thread using <code>thread_detach()</code> |
| 141 | function. Terminated but undetached threads are in the |
141 | function. Terminated but undetached threads are in the |
| 142 | <constant>Undead</constant> state. When the thread is detached or |
142 | <constant>Lingering</constant> state. When the thread is detached or |
| 143 | detaches itself during its life, it is destroyed in the |
143 | detaches itself during its life, it is destroyed in the |
| 144 | <constant>Exiting</constant> state and the <constant>Undead</constant> |
144 | <constant>Exiting</constant> state and the |
| 145 | state is not reached.<figure float="1"> |
145 | <constant>Lingering</constant> state is not reached.<figure float="1"> |
| 146 | <title>Transitions among thread states.</title> |
146 | <title>Transitions among thread states.</title> |
| 147 | 147 | ||
| 148 | <mediaobject id="thread_states" xreflabel=""> |
148 | <mediaobject id="thread_states" xreflabel=""> |
| 149 | <imageobject role="pdf"> |
149 | <imageobject role="pdf"> |
| 150 | <imagedata fileref="images/thread_states.pdf" format="PDF" /> |
150 | <imagedata fileref="images/thread_states.pdf" format="PDF" /> |
| Line 160... | Line 160... | ||
| 160 | </mediaobject> |
160 | </mediaobject> |
| 161 | </figure></para> |
161 | </figure></para> |
| 162 | </formalpara> |
162 | </formalpara> |
| 163 | 163 | ||
| 164 | <formalpara> |
164 | <formalpara> |
| 165 | <title>Pseudo Threads</title> |
165 | <title>Fibrils</title> |
| 166 | 166 | ||
| 167 | <para>HelenOS userspace layer knows even smaller units of execution. |
167 | <para>HelenOS userspace layer knows even smaller units of execution. |
| 168 | Each userspace thread can make use of an arbitrary number of pseudo |
168 | Each userspace thread can make use of an arbitrary number of fibrils. |
| 169 | threads. These pseudo threads have their own synchronous register |
169 | These fibrils have their own synchronous register context, userspace |
| 170 | context, userspace code and stack. They live their own life within the |
170 | code and stack. They live their own life within the userspace thread and |
| 171 | userspace thread and the scheduler does not have any idea about them |
171 | the scheduler does not have any idea about them because they are |
| 172 | because they are completely implemented by the userspace library. This |
172 | completely implemented by the userspace library. This implies several |
| 173 | implies several things:<itemizedlist> |
173 | things:<itemizedlist> |
| 174 | <listitem> |
174 | <listitem> |
| 175 | <para>pseudothreads schedule themselves cooperatively within the |
175 | <para>fibrils schedule themselves cooperatively within the time |
| 176 | time slice given to their userspace thread,</para> |
176 | slice given to their userspace thread,</para> |
| 177 | </listitem> |
177 | </listitem> |
| 178 | 178 | ||
| 179 | <listitem> |
179 | <listitem> |
| 180 | <para>pseudothreads share FPU context of their containing thread |
180 | <para>fibrils share FPU context of their containing thread |
| 181 | and</para> |
181 | and</para> |
| 182 | </listitem> |
182 | </listitem> |
| 183 | 183 | ||
| 184 | <listitem> |
184 | <listitem> |
| 185 | <para>all pseudothreads of one userspace thread block when one of |
185 | <para>all fibrils of one userspace thread block when one of them |
| 186 | them goes to sleep.</para> |
186 | goes to sleep.</para> |
| 187 | </listitem> |
187 | </listitem> |
| 188 | </itemizedlist></para> |
188 | </itemizedlist></para> |
| 189 | </formalpara> |
189 | </formalpara> |
| 190 | </section> |
190 | </section> |
| 191 | 191 | ||