Re: NSNotificationQueue & NSOperationQueue thread death
Re: NSNotificationQueue & NSOperationQueue thread death
- Subject: Re: NSNotificationQueue & NSOperationQueue thread death
- From: Michael Ash <email@hidden>
- Date: Wed, 6 May 2009 13:35:09 -0400
On Wed, May 6, 2009 at 12:58 PM, Eric Hermanson <email@hidden> wrote:
>
> On May 6, 2009, at 12:24 AM, Michael Ash wrote:
>
>> Background threads, whether directly managed by you or
>> indirectly created by NSOperationQueue, do not use a runloop by
>> default.
>
> I did not realize that. I knew threads created by the user did not use
> NSRunLoop, but I assumed threads created by NSOperationQueue did use
> NSRunLoop in some way. So does this essentially mean that you cannot use
> the performSelector... functionality from inside an NSOperation main method
> because the NSOperationQueue thread that runs the operation does not have a
> run loop?
Can you be more specific? There are a *lot* of different
performSelector... methods. Most of them have nothing to do with the
current runloop and will thus work just fine. The "afterDelay"
variants work like a timer and do depend on the current thread running
a runloop, and so can't be used in that context unless you're running
the runloop manually.
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