• 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: Terminating subtasks reliably
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Terminating subtasks reliably


  • Subject: Re: Terminating subtasks reliably
  • From: John Harte <email@hidden>
  • Date: Wed, 31 Mar 2010 10:30:52 -0400


On Mar 31, 2010, at 9:13 AM, John Harte wrote:



What does getppid() returns if the parent dies before the child reach this point ?


Look like a race condition. The man page says getppid() will not fail, but not what happens after the parent dies. I will test this.


If the parent dies, the process becomes the child of launchd. For a quick fix I checked for the parent PID greater than 1.

A better fix, the parent process passed its PID to the child process as an argument. In the child process, if getppid() does not return the PID from the parent process, exit.


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Re: Terminating subtasks reliably (From: John Harte <email@hidden>)
 >Re: Terminating subtasks reliably (From: Jean-Daniel Dupas <email@hidden>)
 >Re: Terminating subtasks reliably (From: John Harte <email@hidden>)

  • Prev by Date: Re: How to add a DOCTYPE declaration to an NSXMLDocument?
  • Next by Date: Moving from nib to code with custom controller.
  • Previous by thread: Re: Terminating subtasks reliably
  • Next by thread: Re: Terminating subtasks reliably
  • Index(es):
    • Date
    • Thread