• 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: Cocoa & signal handlers
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Cocoa & signal handlers


  • Subject: Re: Cocoa & signal handlers
  • From: Greg Parker <email@hidden>
  • Date: Mon, 10 Dec 2001 15:55:07 -0800

On Monday, December 10, 2001, at 02:56 PM, Ingvar Nedrebo wrote:
On Monday, December 10, 2001, at 10:04 , Greg Parker wrote:
You may also be able to use CFRunLoop APIs from CoreFoundation to
wake up the run loop directly. -readInBackgroundAndNotify will
need to do something like this internally, so if this isn't safe
then neither is the pipe.

My understanding from the documentation of readInBackgroundAndNotify
was that it does the read in a separate thread -- on the face
of it it looks fairly safe to do a single system call in a signal
handler, provided of course that the write doesn't block, but
I'm only writing 4 bytes (the signal number).

You may be right, the write() method may be safe even if waking the run
loop from the signal handler is not. -readInBackgroundAndNotify probably
works like CFSocket with a second thread running select(). That thread
does need to wake up the run loop, but it doesn't need to talk to the
run loop during the signal handler.


--
Greg Parker email@hidden Java & Objective C


  • Follow-Ups:
    • Re: Cocoa & signal handlers
      • From: Douglas Davidson <email@hidden>
References: 
 >Re: Cocoa & signal handlers (From: Ingvar Nedrebo <email@hidden>)

  • Prev by Date: Re: Damn sisters :-)
  • Next by Date: Why not to use direct display updates
  • Previous by thread: Re: Cocoa & signal handlers
  • Next by thread: Re: Cocoa & signal handlers
  • Index(es):
    • Date
    • Thread