• 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: Question on threads running in my Foundation tool
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Question on threads running in my Foundation tool


  • Subject: Re: Question on threads running in my Foundation tool
  • From: Michael Ash <email@hidden>
  • Date: Sat, 21 Feb 2009 19:08:50 -0500

On Sat, Feb 21, 2009 at 12:27 PM, Shawn Erickson <email@hidden> wrote:
> On Fri, Feb 20, 2009 at 6:50 PM, Michael Vannorsdel <email@hidden> wrote:
>> It should be more like:
>>
>>        //create timer
>>        //add timer to runloop
>>
>>        CFRunLoopRun(); //code blocks here (not really since the loop is
>> running) until runloop exits due to no longer having observers or timers
>>
>>        //do thread cleanup and exit
>
> Note framework code could add sources to the runloop outside of your
> direct control. This can make depending on the runloop exiting when
> you remove your sources problematic.

Exactly right. When the docs talk about how a runloop will exit when
it has no sources, think of it as a threat, not a promise. It's
behavior you have to guard against, but it's not something you can
count on.

Mike
_______________________________________________

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

  • Follow-Ups:
    • RE: Question on threads running in my Foundation tool
      • From: "Charles E. Heizer" <email@hidden>
References: 
 >Question on threads running in my Foundation tool (From: "Charles E. Heizer" <email@hidden>)
 >Re: Question on threads running in my Foundation tool (From: Nick Zitzmann <email@hidden>)
 >Re: Question on threads running in my Foundation tool (From: "Charles E. Heizer" <email@hidden>)
 >Re: Question on threads running in my Foundation tool (From: Nick Zitzmann <email@hidden>)
 >Re: Question on threads running in my Foundation tool (From: "Charles E. Heizer" <email@hidden>)
 >Re: Question on threads running in my Foundation tool (From: Ken Thomases <email@hidden>)
 >Re: Question on threads running in my Foundation tool (From: Michael Vannorsdel <email@hidden>)
 >Re: Question on threads running in my Foundation tool (From: Shawn Erickson <email@hidden>)

  • Prev by Date: Re: Help with recursive includes
  • Next by Date: Re: Help with recursive includes
  • Previous by thread: Re: Question on threads running in my Foundation tool
  • Next by thread: RE: Question on threads running in my Foundation tool
  • Index(es):
    • Date
    • Thread