• 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: daemon() screws up runloops
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: daemon() screws up runloops


  • Subject: Re: daemon() screws up runloops
  • From: "Alastair J.Houghton" <email@hidden>
  • Date: Wed, 22 Oct 2003 15:04:54 +0100

On Wednesday, October 22, 2003, at 02:42 pm, Wade Tregaskis wrote:

Has anyone else seen the behaviour whereby calling daemon (successfully) screws up any existing run loops... it seems to remove all sources from them, calling any 'run' on them to fall through immediately.

Is there a workaround for this, besides calling daemon before setting up any runloops? It's making it hard to do what I want, due to timing issues with the task launching the daemon.

There have been several comments on Omni's macosx-dev list to the effect that you shouldn't call daemon() or fork() after using any function from any of the higher level frameworks. The reason given was that the initialisation for those libraries had already been done, and a fork()ed copy wouldn't have any way to know that kernel objects that had already been allocated were now invalid (because they refer to a different process' kernel objects).

I assume that when he said that, he meant things like threads (pthreads certainly isn't supposed to be fork() safe, at least not according to SUSv3), and Mach ports.

See, for example,

http://www.omnigroup.com/mailman/archive/macosx-dev/2002-July/ 027969.html

Kind regards,

Alastair.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: Re: daemon() screws up runloops
  • Next by Date: Way to get IB to always be aware of my constantly used classes?
  • Previous by thread: Re: daemon() screws up runloops
  • Next by thread: Way to get IB to always be aware of my constantly used classes?
  • Index(es):
    • Date
    • Thread