• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: waitid() function replacement
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: waitid() function replacement
      • From: "Kevin Harris" <email@hidden>
References: 
 >waitid() function replacement (From: "Kevin Harris" <email@hidden>)

  • Prev by Date: Re: waitid() function replacement
  • Next by Date: Running AIX executables on Intel based Macs
  • Previous by thread: Re: waitid() function replacement
  • Next by thread: Re: waitid() function replacement
  • Index(es):
    • Date
    • Thread