Come for the quick hacks, stay for the epiphanies. | |
PerlMonks |
Re: Unix Review columnby BrowserUk (Patriarch) |
on May 20, 2005 at 15:43 UTC ( [id://459038]=note: print w/replies, xml ) | Need Help?? |
The negative pids aren't produced by win2k, but by Perl's fork emulation on win32 which uses -$tid as the (pseudo-) process id. This behaviour is documented in perlfork and if you page down to the bugs section, you'll see that the problem you encountered with wait is obliquely described there. It makes the correct way to wait for all subprocesses to terminate:
This relies on the fact that the first thread of a process is 1, which means that no forked pseudo-process will have pid of -1 and should therefore work cross-platform. Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
"Science is about questioning the status quo. Questioning authority".
The "good enough" maybe good enough for the now, and perfection maybe unobtainable, but that should not preclude us from striving for perfection, when time, circumstance or desire allow.
In Section
Seekers of Perl Wisdom
|
|