STREAMS/UX for the HP 9000 Reference Manual
94
STREAMS/UX Multiprocessor Support
MP Synchronization Levels on a Uniprocessor
MP Synchronization Levels on a Uniprocessor
This section describes how modules and drivers can use MP synchronization
levels on a uniprocessor system to protect their private data structures
against interrupts. Please read “Writing MP Scalable Modules and Drivers”
in this chapter and “STREAMS/UX Uniprocessor Synchronization” in
Chapter 3 before reading this section.
In addition to the techniques described under “Driver and Module
Synchronization” in Chapter 3, modules and drivers can use MP
synchronization levels to protect their private structures against interrupts.
By default STREAMS/UX configures modules and drivers to use queue pair
synchronization. This is why modules and drivers do not need to raise the
spl level to protect their data if software running on the ICS sends a message
to a stream. Suppose an interrupt occurs while one of a queue pair's entry
points is running. STREAMS/UX will re-schedule sending the message to
the stream to after the entry point finishes executing. You can configure
uniprocessor modules and drivers to use synchronization levels other than
queue pair synchronization if they need more protection.
For example, you could configure a module to use module synchronization
if multiple instances of the module share the same data structure, and if the
module updates the structure when it is running on the ICS. If you configure
the module to use module synchronization, STREAMS/UX will wait until
no instances of the module are running before sending it a message.
Alternatively, you could change the module to raise the spl level while
accessing the shared structure.
You configure synchronization levels for modules and drivers that run on a
uniprocessor system in the same way as for MP scalable modules and
drivers. You must specify the synchronization level the module or driver
uses, and if the module or driver requires elsewhere synchronization, you
must specify a sync name. The sync name indicates which modules and
drivers belong to a group. Pick a sync name with 8 or fewer characters, and
configure the name for each member of the group. You configure the
synchronization level and the sync name in either the master file
$STREAMS_DVR_SYNC table or in an install function streams_info_t
structure.