STREAMS-UX Programmer's Guide (February 2007)
Overview
STREAMS Multiplexor
Chapter 1
16
STREAMS Multiplexor
A stream is a set of components with messages flowing between them. Each module is connected to no more
than one downstream module and one upstream module. Advanced applications can require more complex
configurations than a one-to-one relationship. For instance, multiple modules can communicate with a driver.
Or, a single module may need to route messages to multiple drivers.
The STREAMS multiplexor supports complex configurations between user processes, modules, and drivers.
Figure 1-3, “Multiplexor Configurations.” illustrates the following multiplexor configurations:
• A many-to-one multiplexor routes the data from multiple upper streams to a single lower stream.
Streams above the multiplexor are referred as upper streams. Streams below the multiplexor are lower
streams.
• A one-to-many multiplexor routes messages from one upper stream to multiple lower streams. Streams
below the driver are referred to as lower streams.
• A many-to-many multiplexor routes messages from multiple upper streams to multiple lower streams.
Figure 1-3 Multiplexor Configurations
A multiplexor is a special type of a pseudo-device driver used for multiplexing streams. With the linking
facility, you can dynamically create or dismantle multiplexed streams. Multiplexor configurations can be
combined to create complex variations, as required by the application.
There are two kinds of multiplexors, upper multiplexors and lower multiplexors. The upper multiplexor
multiplexes the streams that are opened to the multiplexor driver by the user processes. The lower
multiplexor deals with the multiple streams between the device driver and the multiplexor.
Driver developers must make explicit design choices to support lower, upper, or both types of multiplexors.
STREAMS provides a flexible framework for connecting streams containing a multiplexor to other
multiplexors, thereby leading to virtually unlimited interconnections. For details of multiplexing driver
development, see Chapter 4, “Modules and Drivers.”
MUX
MUX MUX
One-to-ManyMany-to-One Many-to-Many