Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: waitid() function replacement




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:
http://lists.apple.com/mailman/options/darwin-dev/email@hidden

This email sent to email@hidden
References: 
 >waitid() function replacement (From: "Kevin Harris" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.