pipes under streams

Leslie Mikesell les at chinet.chi.il.us
Fri Jun 23 00:20:23 AEST 1989


In article <256 at unix.SRI.COM> unix.sri.com!orawest!brian writes:
>
>How hard would it be to write a streams driver for named pipes?
>How about regular pipes?  I want to sleep until data arrives from one
>of several processes - is this possible under V.3.2 Unix?

The way to do this using only normal FIFO's is to have all processes
write their data to a single FIFO.  If necessary, put the data in
packets with a tag to identify where it came from (the packet should
be <= PIPE_BUF in size and written in a single write()).  You may
need separate processes to collect from each source stream and generate
the packets.

I'm working on something similar but need to have high and low priority
inputs.  There will be a large volume of low priority input and I need
a way to prevent it from filling the FIFO and making the high priority
processes block.  Can someone suggest a way to do this without adding
a lot of overhead? Perhaps the low priority process could stat() the
FIFO before each write and wait awhile unless it is nearly empty.

Les Mikesell



More information about the Comp.unix.questions mailing list