STREAMS/UX for the HP 9000 Reference Manual
81
STREAMS/UX Multiprocessor Support
Writing MP Scalable Modules and Drivers
and sad drivers use global synchronization. Only one driver function in
ECHO-A, ECHO-B, DLPI-A and SAD-A can run at a time. However, one
of these drivers could run in parallel with a module configured for a
synchronization level other than global. All modules configured with global
synchronization can share data.
The STREAMS/UX synchronization levels also apply to open and close.
For example, if a module is configured for queue pair synchronization, none
of the put or service routines for the queue pair can run at the same time as
the queue pair's open or close. Also, open cannot run at the same time as
close. The least amount of protection that STREAMS/UX provides for
opens and closes is queue pair. Even if a module is configured with queue
synchronization, it will run as if it were configured with queue pair
synchronization during opens and closes.
STREAMS/UX provides additional protection for opens and closes.
STREAMS/UX executes only one open or close across all streams at a time.
For example in Figure 1, if STREAMS/UX is executing the ECHO-A echo
driver's open routine, the DLPI-A dlpi open cannot run nor can any other
module's or driver's open or close. An exception to this occurs if an open or
close sleeps. When this happens, other opens and closes can occur. An open
or close function that sleeps may need to use a spinlock together with the
get_sleep_lock, SV_WAIT or SV_WAIT_SIG utilities to prevent missing
wakeups. These utilities are described in the “HP-UX Modifications to
STREAMS/UX Utilities” section in Chapter 3. Also, SV_WAIT and
SV_WAIT_SIG are discussed in the SVR4.2 Driver manual.
STREAMS does not synchronize the running of timeout and bufcall
callback functions with modules and drivers. This chapter lists some
restrictions on what these callback functions can do.
Suggestions for Designing MP Scalable Modules and Drivers
This section contains recommendations for designing MP scalable modules
and drivers:
• Modules and drivers that run over UP emulation hardware drivers must run under
UP emulation. Before changing STREAMS/UX modules and drivers to be MP
scalable, modify hardware drivers to be MP scalable.
• You can improve the performance of modules and drivers by using the elsewhere
synchronization level. Configure all modules and drivers in a subsystem to be in