STREAMS Programming Guide

Exit Print View

Updated: July 2014
 
 

Message Queues

The queue is the fundamental component of a stream. It is the interface between a STREAMS module and the rest of the stream, and is the repository for deferred message processing. For each instance of an open driver or pushed module or stream head, a pair of queues is allocated, one for the read side of the stream and one for the write side.

The RD(9F), WR(9F), and OTHERQ(9F) routines allow reference of one queue from the other. Given a queue, RD(9F) returns a pointer to the read queue, WR(9F) returns a pointer to the write queue and OTHERQ(9F) returns a pointer to the opposite queue of the pair (see queue(9S)).

By convention, queue pairs are depicted graphically as side- by- side blocks, with the write queue on the left and the read queue on the right (see following figure).

Figure 7-7  Queue Pair Allocation

image:Diagram shows an allocated queue pair, one for the read side and one for the write side.