in reply to Launching multiple commands in parallel

Once you fork, it's up to the parent process to decide to wait or not. Most examples show a wait call in the parent after the fork, but it doesn't have to be coded that way. You will need to wait at some point to reap those children though. Otherwise you'll end up with zombie processes. waitpid will let you do non-blocking waits on chidren using the &WNOHANG flag. YMMV on non-UNIX systems.

  • Comment on Re: Launching multiple commands in parallel

Replies are listed 'Best First'.
Re: Re: Launching multiple commands in parallel
by Anonymous Monk on Mar 06, 2002 at 15:04 UTC
    I do a waitpid but is seems to wait for all of the children....