STREAMS/UX for the HP 9000 Reference Manual

46
Differences Between STREAMS/UX and System V Release 4 STREAMS
HP-UX Modifications to STREAMS/UX Utilities
streams_put utilities
STREAMS/UX provides a new utility streams_put, which allows
non-STREAMS/UX software to safely call STREAMS/UX utilities. timeout
and bufcall user functions and other non-STREAMS/UX code cannot call
several of the STREAMS/UX utilities or share data with modules and
drivers. For a more detailed discussion about these restrictions, see
“STREAMS/UX Uniprocessor Synchronization” in this chapter and
“Writing MP Scalable Modules and Drivers” in Chapter 4.
Non-STREAMS/UX code can call streams_put, passing it a function and a
queue. STREAMS/UX runs the function as if it were the queue's put
routine. The function can safely manipulate the queue and access the same
data structures as the queue's put routine.
#ifdef _PROTOTYPES
typedef void (*streams_put_t)(void *, MBPKP);
#else
typedef void (*streams_put_t)();
#endif
void
streams_put(func, q, mp, private)
streams_put_t func;
queue_t *q;
mblk_t *mp;
void *private;
STREAMS/UX will run func as if it were q's put routine. STREAMS/UX
passes private and mp to func. The non-STREAMS/UX code can pass any
value in the private parameter. The code must pass a valid message block
pointer in mp. streams_put uses fields in the message block not visible to the
STREAMS/UX programmer.
SV_WAIT
STREAMS/UX implements a subset of the SVR4 MP synchronization
variable utilities using sleep and wakeup. The HP-UX SV_WAIT differs
from the SVR4 MP utility in the following ways. When the SVR4 MP
SV_WAIT returns, the lkp spinlock is not held, and the priority level is set to
plbase (SPLNOPREEMPT on HP-UX). On a multiprocessor system, the
HP-UX SV_WAIT lowers the priority level to the value before the caller
acquired the lkp spinlock, which may not be SPLNOPREEMPT. If the caller
acquired the lock while holding other spinlocks, the priority level is lowered
to the value before the first of these nested spinlock calls. Also, the SVR4