in reply to Re: Forking and running all child processes at the same time
in thread Forking and running all child processes at the same time
won't work on windows systems. The windows implementation uses the negative of the thread ID as the pid, so wait returns negative numbers for all children. It seems the most cross-platform wait statement is:1 while wait > 0; # avoid zombies
since the main thread is ID 1, and the child threads won't have that ID. And it's what wait natively returns when there are no further child processes. - j1 while wait != -1 ; # avoid zombies
|
|---|