B.9.3 Leaving a Subsystem-Parallel Stack (Exit Module)

In STREAMS, a thread executing a service procedure remembers if it is executing within a subsystem-parallel stack, which is necessary if the thread calls bufcall or timeout while it is within the stack. This feature preserves the subsystem-parallel stack requirement of a nonpreemptive uniprocessor environment.

If the thread leaves the stack by calling the put procedure of the next queue, STREAMS must be notified. The mechanism for this is the exit module. The stack includes an upper exit module and a lower exit module, similar to insulating modules, one for each boundary of a subsystem. The upper exit module queues all puts on its read queue to its service procedure.

The lower exit module queues all puts on its write queue to its service procedure.

The plumbing daemon of a subsystem-parallel stack must ensure that the appropriate exit modules are pushed above and below the stack. Sample source code for the exit modules is included in the Windows NT DDK. The insulating and exit modules may be combined into a single module if desired.