• 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: [Q] CFSocket & RunLoop --2nd try
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Q] CFSocket & RunLoop --2nd try


  • Subject: Re: [Q] CFSocket & RunLoop --2nd try
  • From: Douglas Davidson <email@hidden>
  • Date: Thu, 22 Jan 2004 11:01:13 -0800

On Jan 22, 2004, at 6:57 AM, Shawn Erickson wrote:

An important thing to note about run loops are that they can only be run if it they have at least one input source. If they are running and the last input source is removed (or invalidated I believe) the run loop will return (stop running).

However, bear in mind that it is not always the case that the only sources installed are your own. Various frameworks may install run loop sources for their own purposes, so it is not wise to rely on the removal of the last input source to stop the running of the run loop. In many cases an entire thread is intended to operate within the run loop, so that the run loop does not need to stop running before the thread (or process) exits. If, however, you need to stop running a run loop and continue execution on a particular thread, the instead of using the convenience function CFRunLoopRun, you can instead call CFRunLoopRunInMode in a loop, and in the condition for the loop check something that indicates whether all of the run loop processing you needed is complete.

Douglas Davidson
_______________________________________________
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.

References: 
 >[Q] CFSocket & RunLoop --2nd try (From: Rogier Bosch <email@hidden>)
 >Re: [Q] CFSocket & RunLoop --2nd try (From: Shawn Erickson <email@hidden>)

  • Prev by Date: [ANN] UKDistributedView 0.4, UKToolbarFactory etc.
  • Next by Date: newbie:using NSData (with NSDocument)
  • Previous by thread: Re: [Q] CFSocket & RunLoop --2nd try
  • Next by thread: safari define referrer
  • Index(es):
    • Date
    • Thread