pipe, FIFO
I need to 'split' output of a process to two identical FIFO pipes, so that two processes can read same output.
can you please tell me how to do it? thanks. |
I think "tee" may help you to split the output into two fifos. At least, that's what the commands below do. But having experimented a bit, both fifo1 and fifo2 will remain "blocked", until they have both been connected to an output process.
"Tee" normally expects a filename as its argument. But here, a process substitution is used to redirect that output into fifo1 instead. The commands below create two fifos, direct some data into them, and then connect each fifos to its own output process... Code:
mkfifo fifo1 Code:
$ cat test1 |
thanks, but I've been trying tee for hours with no success. I'm using video streams, and two vlc players at 'end' of pipes. but it seems that only one pipe can work, not two at same time. maybe the problem is in very small buffer of fifo. so it breaks when one pipe is 'faster'.
|
Quote:
I haven't tried it myself, but this post here suggests howto resize the pipe buffer. |
It seems likely to me that video streaming data would exceed the design capacity of a pipe. What I would expect to be used in this case is a shared-memory buffer of some kind. (And I would fully expect such a thing to already exist, so look before you write.)
|
All times are GMT -5. The time now is 04:10 AM. |