STREAMS/UX for the HP 9000 Reference Manual

93
STREAMS/UX Multiprocessor Support
Porting SVR4 MP Modules and Drivers to HP-UX
Strategies for Porting SVR4 MP Modules and Drivers to HP-UX
The best way to port SVR4 MP scalable modules and drivers to HP-UX is to
change the SVR4 MP code to use the STREAMS/UX synchronization
levels. First, analyze how the SVR4 MP code shares data structures, and
then configure the modules and drivers to use synchronization levels which
correctly serialize access to shared data. You can use defines to change
module and driver spinlock calls to no-ops. This approach is likely to get the
best performance, but may require much effort. Also, the STREAMS/UX
synchronization levels may not be suitable for all designs.
To make porting easier, STREAMS/UX will provide support for the SVR4
MP spinlock primitives. SVR4 MP modules and drivers could be ported to
HP-UX by configuring them to run with queue synchronization and leaving
in the calls to SVR4 MP spinlock routines. A disadvantage of this porting
strategy is that it may not achieve as much performance as the first. Some of
the synchronization provided by STREAMS/UX will be redundant with the
synchronization implemented by module and driver spinlocks. In some
cases, a combination of these two strategies may make sense. For example,
suppose several modules and drivers share the same structure, but do not
access it on the main read and write paths. You can use SVR4 MP spinlocks
to protect this data, but use the STREAMS/UX synchronization levels to
protect other structures.