DCPM: fork oddness
Alex Charrett
alex at dclug.org.uk
Tue Nov 26 13:17:56 CST 2002
On Tue, 2002-11-26 at 09:15, Steve Marvell wrote:
> On Tue, Nov 26, 2002 at 01:03:30AM +0000, Alex Charrett wrote:
>
> > I'm having an odd issue with fork maybe you guys can shed some light on.
> > I've got a constantly running process that forks itself when doing time
> > consuming tasks to make the front end script more responsive. It's
> > doing it's job nicely and I've got an exit(0) to get the child to
> > terminate at the correct time.
> >
> > However, the exit is causing defunct processes to sit in the process
> > list until the parent exits (which I don't want it to do as the parent
> > isn't meant to exit).
>
> The parent should wait() or waitpid() for the child after it
> dies. You'll know when it dies from the SIGCHLD in the parent, which
> you'll need to trap.
Ok, that seems to be working until I hit the point where I may have more
than one child at a time, how do I tell which is sending me the SIGCHLD?
Alex.
More information about the Devoncornwall-pm
mailing list