STREAMS/UX for the HP 9000 Reference Manual

92
STREAMS/UX Multiprocessor Support
Porting SVR4 MP Modules and Drivers to HP-UX
Porting SVR4 MP Modules and Drivers to HP-UX
Please read the previous section, “Writing MP Scalable Modules and
Drivers,” before this one. If you compare the previous section to the
SVR4.2 STREAMS manual, you will notice that there are some differences
between SVR4 MP STREAMS and HP-UX MP STREAMS. This section
discusses these differences and describes strategies for porting SVR4 MP
modules and drivers to HP-UX.
Differences between SVR4 and HP-UX MP STREAMS
HP-UX STREAMS provides MP scalability differently from SVR4 MP
STREAMS. There are two main differences. The first pertains to which
STREAMS/UX entities run in parallel. SVR4 MP STREAMS executes put
and service routines for the same queue concurrently although only one
instance of a service routine can run at a time. HP-UX, unlike SVR4 MP,
allows the developer to configure which STREAMS/UX entities run in
parallel. The most parallelism that a STREAMS/UX developer can
configure is to run entry points for different queues concurrently. Unlike
SVR4 MP, HP-UX only allows one entry point for a queue to run at a time.
The put and service routines for the same queue cannot run in parallel. Also,
multiple instances of a queue's put or service routine cannot execute
concurrently.
The second difference has to do with synchronizing access to module and
driver private data structures. SVR4 MP STREAMS does not provide
protection for private structures. The module or driver code uses spinlocks
to synchronize access. STREAMS/UX provides protection for private
structures. The developer configures the amount of concurrency for a
module or driver based on the entities with which it shares data structures.
For example, if all instances of a module access the same table, the
programmer can configure the module so that only one instance runs at a
time.