next up previous
Next: Global Scheduler (trusted) Up: Strands Previous: Events Handled by

Kernel Strand Package & Scheduler (trusted)

Kernel strands are minimal threads that run in the kernel address space and are used to execute the spindles that are to be fired in response to an event. They are efficiently created and destroyed by the kernel strand package and scheduler.

Efficient creation in this context means that the absolute minimum amount of work is performed to get a spindle executed. For instance, the kernel strand package can reuse the stack of a blocked user-level thread and can execute successive handlers without saving any state (unless they block, in which case minimum state to unblock and restart is saved). Thus, even interrupt handlers run as threads and use the same synchronization primitives as regular extension code.

The kernel strand scheduler receives the set of spindles to execute from the event dispatcher. Although the kernel strand scheduler conforms to the spindle event interface, it does not go through the event dispatcher (since the kernel strand scheduler is involved in event handling, going through the dispatcher would cause infinite regress). The attributes of the spindles to execute (e.g. their scheduling priority with respect to other strands) is registered with the kernel strand scheduler by the event dispatcher at the time the spindles are installed (and may be changed at any later time).



Emin Gun Sirer
Sat Jun 22 19:01:37 PDT 1996