STREAMS/UX for the HP 9000 Reference Manual
76
STREAMS/UX Multiprocessor Support
Running Modules and Drivers in Uniprocessor Emulation Mode
mode. Another example is STREAMS/UX pipes, which are MP scalable. If UP
emulation modules are pushed onto a pipe, the pipe runs under UP emulation.
• As described earlier in this section, all user bufcall callback functions are
executed in UP emulation mode. If an MP scalable module calls bufcall, the
callback routine runs under UP emulation. If the callback routine invokes a put
procedure, the put procedure also runs in UP emulation mode. For example, the
DLPI driver is MP scalable in 10.0 and calls bufcall. The bufcall callback
function runs under UP emulation.
Performance
Performance of UP emulation modules and drivers will likely worsen as
more processors are added to a system. If a large number of users will be
running your modules and drivers on MP systems, you should probably
modify the code to be MP scalable.
MP scalable modules that run over non-STREAMS/UX UP emulation
drivers will be forced to run in UP emulation mode. You can achieve better
performance by changing drivers to be MP scalable.
Guidelines for UP Emulation Modules and Drivers
• It is easier to develop STREAMS/UX based software which runs completely
under UP emulation or is completely MP scalable. Try to avoid mixing UP
emulation and MP scalable modules and drivers in the same stream or
multiplexor.
• It may be safe for UP emulation modules and drivers to call MP scalable
non-STREAMS software. The MP scalable software must be able to run while
the I/O semaphore is held. Note that if a put or service routine calls
non-STREAMS functions, these functions cannot acquire semaphores because
this might cause the put or service routine to block.
• Be careful with MP scalable non-STREAMS kernel code when calling UP
emulation STREAMS/UX modules. It is better if the non-STREAMS code
schedules a service routine instead of invoking a put procedure. Scheduling the
service routine will wake up the UP emulation scheduler daemon to run the
routine. The daemon acquires the I/O semaphore. If non-STREAMS code calls
put, putnext, or streams_put, STREAMS/UX will not acquire either the I/O
semaphore or the spl lock.
• Modules and drivers which can run MP scalable and run under UP emulation
must use queue or queue pair synchronization. An example of an MP scalable