STREAMS-UX Programmer's Guide (February 2007)
Multiplexing
STREAMS Multiplexor
Chapter 5
136
Upper Read Service Procedure
The upper read service procedure is provided for flow control purposes only. It is scheduled to run when the
flow control on the upper stream’s read side is lifted. If the multiplexor still has the lower stream linked to it,
mux_ursrv() will enable the lower streams read queue. The code for the upper read service procedure is as
follows:
int
mux_ursrv(q)
queue_t * q;
{
if (muxbot_wq) {
/* if the stream is still linked under the multiplexor
* enable it’s read side service procedure
*/
qenable(RD(muxbot_wq));
return;
}
Lower Write Service Procedure
The lower write service procedure is responsible for enabling all the upper write queues that have messages
on them. The mux_lwsrv() is scheduled to run when flow control on the linked stream below the multiplexor
is removed. The code for the lower write procedure is as follows:
int
mux_lwsrv(q)
queue_t * q;
{
...
for(index=0; index<MUXCNT; index++)
if (mux_list[index].top_rq &&
(WR(mux_list[index].top_rq))->q_first)
qenable(WR(mux_list[index].top_rq));
return;
}