P
Peter J. Holzer
I've thought (and read) a lot about this. I believe now, that my guess
is wrong.
There's no problem with zombies (and respectively waiting for childs).
As C.DeRykus clearly showed double fork doesn't help.
Now, I think, that B<perl> waits till pipe closes.
It doesn't (at least not during a close which I believe we are talking
about here - of course since Perl is a general purpose programming
language, perl can be made to wait on just about anything). A close on a
filehandle created with "open(... '...|')" waits for the child process
to terminate. If the child process forks again and terminates (as
C.DeRykus) suggested, close returns immediately, as expected.
I don't see where "C.DeRykus clearly showed double fork doesn't help".
On the contrary, I very clearly showed that it does help in a previous
posting.
That happens when writer (I intentionally say 'writer' but 'child',
because it can be child of B<init> (since double fork)) intentionally
closes pipe or just terminates.
When the writer closes the pipe, the reader will get an EOF indication.
hp