wolf blaum wrote: > On Wednesday 03 March 2004 21:57, Bob Showalter generously enriched > virtual reallity by making up this one: > > Hi, > > > > - "1 while wait() > 0" > > > > That just reaps the exit statuses to prevent zombies; the children > > have already exited (otherwise the loop wouldn't have exited.) You > > might want the exit statuses or not. You can also usually use > > $SIG{CHLD} = 'IGNORE' prior to the forking loop if you don't care > > about exit statuses. see "perldoc perlipc" > > Uh, I appologize - anyway, could you explain that last part to me? > Do you create zombies if you dont handle the exit status of you child > by either wait()ing or setting the signal handler? An what does that > zombie do anyway.
When a process ends, the OS keeps the process table entry around until the parent reaps the exit status by calling wait(). If the parent process is long-running and doesn't reap the children, you have these "zombie" process table entries lying around. (The process itself is gone; just the process table entry remains.) If the parent exits, the children are inherited by the "init" process, which periodically reaps any exit statuses. So, the only problem is really if the parent is long-running. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>