STREAMS/UX for the HP 9000 Reference Manual
64
Differences Between STREAMS/UX and System V Release 4 STREAMS
STREAMS/UX Uniprocessor Synchronization
Multiple Processes Accessing the Same Stream
STREAMS/UX synchronizes multiple processes that are accessing the same
stream. Three scenarios will allow more than one process to operate on a
stream:
• Multiple processes opening a non-cloneable device with the same minor number
• A process calling fork
• Processes issuing I_SENDFD and I_RECVFD ioctls
For synchronization, STREAMS/UX will queue some open and ioctl system
calls issued by different processes, and will execute them one at a time.
STREAMS/UX queues re-opening an already open stream, and queues the
following ioctls: I_PUSH, I_POP, I_LINK, I_PLINK, I_UNLINK,
I_PUNLINK, I_FLUSH, I_FLUSHBAND, I_GETCLTIME,
I_SETCLTIME, I_GETSIG, I_SETSIG, I_LIST, I_LOOK, and I_STR.
STREAMS/UX does not process a close call until the last file descriptor for
a stream is closed. No other system calls will be executing when
STREAMS/UX begins to dismantle the stream.
For remaining system calls, STREAMS/UX ensures that consistent results
are returned, but the calls are not executed one at a time. For example, if
two processes are reading from the same stream, one process could read the
first and third messages on the stream to satisfy a read request while the
second process reads the second and fourth messages.
The STREAMS/UX Scheduler
The STREAMS/UX scheduler runs service routines that are scheduled by
STREAMS/UX utilities such as putq. The scheduler will run all scheduled
service routines before returning to user level. The scheduler is a real time
daemon that runs at priority 100. (A low priority number denotes a high
priority. For example, a priority number of 50 would be of higher priority
than the number 100.) STREAMS/UX applications need to run at a lower
priority (higher priority number) than the STREAMS/UX scheduler;
otherwise service routines will not run before the scheduler returns to user
level from the kernel.