• 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: CFRunLoopRun() and processing posix signals
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CFRunLoopRun() and processing posix signals


  • Subject: Re: CFRunLoopRun() and processing posix signals
  • From: "A.M." <email@hidden>
  • Date: Tue, 23 Nov 2010 14:54:42 -0500

On Nov 23, 2010, at 12:55 PM, Philippe Strauss wrote:

> Hello Cocoa developpers,
>
> When using a CFRunLoopRun() event loop in a non-GUI daemon, what kind of resource and handler do you need to add to the loop for beeing able to process signals (unix signals) and not beeing stuck in:
>
> (gdb) bt
> #0  0x00007fff815592da in mach_msg_trap ()
> #1  0x00007fff8155994d in mach_msg ()
> #2  0x00007fff83f87932 in __CFRunLoopRun ()
> #3  0x00007fff83f86dbf in CFRunLoopRunSpecific ()
> #4  0x00007fff83f86b46 in CFRunLoopRun ()
> #5  0x00000001000017af in main (argc=0, argv=0x7fff5fbfe418) at jackond.cpp:331

CFRunLoop does not normally process signals, however, it is possible to hack it in with CFFileDescriptor and kqueue. Look at Apple example code to accomplish this, specifically this function:

static void InstallHandleSIGTERMFromRunLoop(void)

http://developer.apple.com/library/mac/#samplecode/PreLoginAgents/Listings/PreLoginAgentCarbon_main_c.html#//apple_ref/doc/uid/DTS10004414-PreLoginAgentCarbon_main_c-DontLinkElementID_3

Cheers,
M_______________________________________________

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: 
 >CFRunLoopRun() and processing posix signals (From: Philippe Strauss <email@hidden>)

  • Prev by Date: CFRunLoopRun() and processing posix signals
  • Next by Date: Re: Core data fetch and multithreading
  • Previous by thread: CFRunLoopRun() and processing posix signals
  • Next by thread: Making a Label (NSTextField) clickable
  • Index(es):
    • Date
    • Thread