Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Unix Review column

by BrowserUk (Patriarch)
on May 20, 2005 at 15:43 UTC ( #459038=note: print w/replies, xml ) Need Help??


in reply to Unix Review column
in thread wait problem for WIN32 perl

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:

1 while wait() != -1;

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.

Replies are listed 'Best First'.
Re^2: Unix Review column
by merlyn (Sage) on May 20, 2005 at 17:55 UTC

      That's one favour I've repaid. Just another few hundred to go :)


      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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://459038]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (4)
As of 2022-11-29 04:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?