Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Bi-directional pipe



On Jun 7,  2:50pm, Guillaume Chazarain wrote:
}
} Is there a way to make a bi-directional pipe in zsh?

Peter has already given an answer to this, but I just have to add that
having two processes connected in a loop this way is a sure road to
deadlock unless both processes are fully prepared for it (which means
for example that they're polling their input and output with select()
or poll() and using non-blocking reads and writes).

It might *seem* to work in simple tests, but that's just because the
operating system and/or the I/O library are doing buffering of the
input and output streams.  As soon as one of the processes produces
more output than will fit in the buffer, you're in deep trouble.



Messages sorted by: Reverse Date, Date, Thread, Author