The stupid question is the question not asked | |
PerlMonks |
Re: Wait hangs when pipe is fullby Abigail-II (Bishop) |
on Sep 03, 2003 at 08:44 UTC ( [id://288545]=note: print w/replies, xml ) | Need Help?? |
The problem is that your buffers are filling up.
You keep on writing to your pipe, but you don't
read from it until all children have finished
writing. But eventually, the buffer fills up,
the child that's currently writing cannot write
and hence will block. In the main time,
your main program is waiting for the child to
exit.
So, you have a deadlock. You have a child that is waiting for the parent to read something, and a parent that's waiting for a child to terminate. Abigail
In Section
Seekers of Perl Wisdom
|
|