STREAMS-UX Programmer's Guide (February 2007)

Synchronization Levels
Queue Level Synchronization
Appendix F
284
Queue Level Synchronization
The queue level synchronization serializes access to a queue so that only one request is processed at a time.
Requests to different queues can run in parallel.
For example, if the echo driver in Figure F-1, “Synchronization Levels,is configured for queue
synchronization, the following procedures will not execute concurrently:
ECHO-A’s echo_rput and echo_rsrv procedures.
ECHO-A’s echo_wput and echo_wsrv procedures.
However, in this synchronization mode, STREAMS/UX will run the following concurrently:
ECHO-A’s echo_rput and ECHO-As echo_wput procedures.
Any of ECHO-As procedures with any of ECHO-B, DLPI-A or SAD-A’s procedures.
If a module uses queue synchronization, a queue’s put and service procedures can share data with each other.
This occurs because STREAMS/UX does not execute these procedures concurrently.
Queue-Pair Level Synchronization
The queue-pair level synchronization serializes the read-and write-queue pair of a module/driver. This level of
synchronization ensures that only one request to this queue pair is processed at a time. Requests to different
queue pairs can run in parallel.
For example, if the echo driver in Figure F-1, “Synchronization Levels,is configured for queue-pair
synchronization, then at any given time, only one of ECHO-As echo_rput, echo_rsrv, echo_wput, and
echo_wsrv can run. However, an ECHO-A routine can run in parallel with an ECHO-B routine.
If a module uses queue-pair synchronization, the read queue and write queue can share data with each other.
Module Level Synchronization
The module level synchronization serializes access to all the instances of the module. This synchronization
ensures that only one request for the instances of this module can be processed at a time. Requests to
different modules can run in parallel.
For example, in Figure F-1,Synchronization Levels,if the echo driver is configured for module
synchronization, then only one request to any ECHO-A or ECHO-B will be processed at a time. However,
STREAMS/UX will be able to process the requests to a dlpi or sad driver at the same time.
With module synchronization, all instances of this module can share data with each other.