in reply to fork exits prematurely leaving zombies

So the parent forks C, then forks B, then does A. When A is finished, then B and C will be reaped, meanwhile if they are already done then they are zombies.

Would be cleaner to:

if (!fork) { <process A>; exit } if (!fork) { <process B>; exit } if (!fork) { <process C>; exit } # parent waits for A, B, and C 1 while wait() > 0;

Replies are listed 'Best First'.
Re: Re: fork exits prematurely leaving zombies
by perllearner (Novice) on May 13, 2004 at 01:10 UTC
    thanks zude and steve for your responses. i think i now got it working (hopefully).