next up previous contents index
Next: External Threads Up: Usage Rules Previous: Scheduling and Preemption

Blocking

   

Although the x-kernel advocates a ``thread-per-message'' model and it provides primitives for blocking threads, as a general rule, threads should not block except when waiting for a reply in an RPC-like protocol. In most other cases, should a thread not be able to proceed, it should put the message in a protocol-dependent queue and return. Later, another thread can pick up the message from the queue and continue processing it.

For example, when an incoming thread/message arrives in IP and discovers that it is just one fragment of a larger datagram, rather than blocking the thread and waiting for the other fragments to arrive, the thread should insert the fragment into a reassembly buffer and return. The thread that delivers the last fragment will then reassemble the fragments into a single datagram and continue.



Larry Peterson
Wed Jan 10 10:40:08 MST 1996