in reply to Wait hangs when pipe is full
For one thing, this code doesn't use named pipes. Named pipes are ones that are created with mkfifo, for instance.
For another, read up on pipe. It specifically warns you about deadlocks.
The Camel has a few more words on this subject as well.