STREAMS-UX Programmer's Guide (February 2007)

Overview
Messages and Queues
Chapter 1
15
Message Processing
Each queue is associated with a put procedure and an optional service procedure to process the messages.
The put procedure is used to process the messages from the preceding queue in a stream. Depending on the
message type and the availability of the next module, the put procedure can consume this message and pass
it to the next queue for further processing. Alternatively, the put procedure may place the messages on its
message queue for processing later.
The service procedure is used to process the messages in the message queue. A queue will always contain a
put procedure, but not necessarily a service procedure. Depending on the nature of the module, the module
designer determines whether a service procedure is necessary. If the put procedure allows the messages to
be queued on its own message queue, a corresponding service procedure should be provided to process these
messages.
See Chapter 4 for more information on the put and service procedures.
A limit can be set for each queue. This limit is the maximum amount of data that can be queued in the
message queue. This data flow control mechanism to allow the STREAMS modules to control the amount of
data flow in the stream. HP recommends using data flow control for modules or drivers.