Re: waitid() function replacement
Re: waitid() function replacement
- Subject: Re: waitid() function replacement
- From: Eric Gouriou <email@hidden>
- Date: Wed, 5 Apr 2006 20:11:03 -0700
On Apr 5, 2006, at 17:35 , Kevin Harris wrote:
Here's my situation:
My program spawns processes and needs to be able to signal (for
termination purposes, if they don't quit on their own) the process
as well as any other process it has started (within the same
process group). It is not possible to use waitpid() on the process
(or process group), if the process has quit, as it will then become
unsafe to send a term or kill signal to that process group. This
is because of a potential race condition where another process may
have started with the same PID.
The PID cannot be reused until your parent process gives a chance
to the OS to reap
the zombie.
On most Unix-derived OSes you should be able to set your SIGCHLD
handling in such
a way that the children will remain zombies until wait() or waitpid()
is used.
This removes the race condition you are concerned about.
Eric
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden