Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: fork exits prematurely leaving zombies

by Steve_p (Priest)
on May 11, 2004 at 19:20 UTC ( [id://352558]=note: print w/replies, xml ) Need Help??


in reply to fork exits prematurely leaving zombies

My forking is a bit rusty, so hopefully, I'm getting this right. Since process A is the parent of process B, there should be a wait there. Otherwise if process A finishes, it will wait on process C only. So, if process C finishes before process B, you'll get a zombie. The following may work a bit better.

if ($pid = fork()) { if ($pid2 = fork()) { <process A>; waitpid $pid2, 0; } else { <process B>; exit; } waitpid $pid, 0; } else { <process C> exit; }

Replies are listed 'Best First'.
Re: Re: fork exits prematurely leaving zombies
by thor (Priest) on May 11, 2004 at 23:30 UTC
    My forking is a bit rusty
    This is so rife with comedic possibility...

    thor

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (4)
As of 2024-04-18 04:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found