next up previous
Next: SPIN Architecture Overview Up: Strands Previous: Strands

What are Strands ?

Strands are the units of execution in SPIN. Under traditional systems, the definition of the unit of execution (i.e. thread, process, actor) is a stone-cast choice made by the system designers. Often, there is an impedance mismatch between the amount of state offered by kernel supported threads and user needs, which has given rise to numerous methods of multiplexing ``lightweight'' threads on top of heavier, more general purpose kernel abstractions. Further, scheduling decisions on multi-user systems happen outside of application control. In general, there is no easy way to subscribe to a scheduling policy aside from what is implemented in the kernel and continue to interact with the rest of the system. In essence, the problem with the traditional approach is that the notion of a thread of execution and the behaviour of threads, especially with respect to the scheduler, cannot be extended.

SPIN supports extensibility by allowing users to define the exact amount of state that their threads need. In addition, SPIN supports arbitrary user-defined scheduling policies.

Further, SPIN supports fine-grain extensibility - that is, entire subsystems need not be rewritten to affect an incremental change in a small section of a module. The strands interface supports this goal by cleanly partitioning the decision of what a thread is from when it should be run. Schedulers are cleanly separated from thread implementations so that either can be extended or abridged independently.

In order for the rest of the system to be able to communicate with such a diverse set of thread implementations, all strands packages should support a common baseline, the strands interface.

To recap on terminology, a strand is the unit of execution in SPIN. A strands package defines what exactly a unit of execution is. A strand scheduler decides when the execution should occur. The strand scheduler and the strands package may be integrated into a single module, but not necessarily. A spindle is some code that is loaded into the kernel and is registered with the dispatcher as awaiting execution based on some system event. Currently, the unit of code injection into the kernel is a module, which is a collection of related spindles.

The details of the strand interface are described below.



next up previous
Next: SPIN Architecture Overview Up: Strands Previous: Strands



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