Talk:Anonymous pipe

Latest comment: 15 years ago by Jhwinters in topic Is simplex means half-duplex here ?

i must say that i find it a bit laughable that an article on pipes goes into detail about the windows implementation of the matter and lists unix in the references section only.

yes it was laughable. I've added a stub section linking to the main Pipeline (Unix) article JonathanWakely (talk) 00:48, 20 November 2007 (UTC)Reply

Is simplex means half-duplex here ?

edit

Hi,

I was wondering, the article says anonymous pipe are for simplex communication between two processes, and, from what I understand, the article wants to mean that when you create an anonymous pipe, only one process can read an end and only one other process can read the other end. But is it really true ? I don't know what POSIX says about this, but on Linux, anonymous pipe are working on a "half-duplex" mode, if I can say. Both processes can write on the "write end", both processes can read from the "read end". —Preceding unsigned comment added by 69.157.135.245 (talk) 01:27, 7 July 2008 (UTC)Reply

Once you start talking about simplex/half-duplex/full-duplex you need to be aware that different levels of your communication stack may have different characteristics in this area.

The original UNIX pipe model was simplex. That is, each pipe had an input end and an output end (a writing handle and a reading handle). Anything written to the input end could be read later from the output end.

Using such a simplex pipe it is perfectly possible to implement half-duplex communication. Both processes involved need to have access to both file handles and each writes to the writing one and reads from the reading one. Some sort of "over" indicator needs to be implemented in the protocol which they are using so that each knows when to stop reading and let the other one have a go.

In practice, all current UNIX pipes (AFAICT) are full-duplex. That is, when they are created you get back two handles, one for each end of the pipe, but you can read from or write to either of them. Call them handle A and handle B. If you write data to handle A then it can be read from handle B, and vice versa. You can of course still use them for simplex or half-duplex communication. I have been told that the original implementation was full-duplex, but merely documented as simplex. I have been unable to verify this claim. Jhwinters (talk) 16:41, 24 March 2009 (UTC)Reply