STREAMS/UX for the HP 9000 Reference Manual

79
STREAMS/UX Multiprocessor Support
Writing MP Scalable Modules and Drivers
Figure 1 Understanding STREAMS/UX MP Support
The queue synchronization level provides the most concurrency. It
serializes access to a queue so that only one function at a time can
manipulate the queue. Applications can take advantage of multiple
processors because functions that operate on different queues run in parallel.
For example, assume that the echo driver in Figure 1 uses queue
synchronization. STREAMS/UX does not run ECHO-A's echo_rput and
echo_rsrv in parallel. Also, STREAMS/UX does not execute ECHO-A's
echo_wput and echo_wsrv concurrently. However, STREAMS/UX can run
ECHO-A's echo_rput at the same time as ECHO-A's echo_wput.
STREAMS/UX allows ECHO-A's read queue functions to run in parallel
with ECHO-A's write queue routines. Also, any of ECHO-A's procedures
can run at the same time as ECHO-B, DLPI-A or SAD-A routines. If a
module uses queue synchronization, a queue's put and service routines can
easily share data with each other because STREAMS/UX does not execute
the routines concurrently.
The queue pair synchronization level serializes access to a read and write
queue pair so that only one of the queue pair's functions can run at a time.
Queue pair synchronization still allows concurrency because functions for
Stream Head
Read Queue Write Queue
echo_rput
echo_rsrv
echo_wput
echo_wsrv
ECHO-A
Stream Head
Read Queue Write Queue
dlpi_rput
dlpi_rsrv
dlpi_wput
dlpi_wsrv
DLPI-A
Stream Head
Read Queue Write Queue
sad_rput
sad_rsrv
sad_wput
sad_wsrv
SAD-A
Stream Head
Read Queue Write Queue
echo_rput
echo_rsrv
echo_wput
echo_wsrv
ECHO-B
Echo
Echo
Sad
Dlpi