Re: Thread Safety of performSelector:withObject:afterDelay:?
Re: Thread Safety of performSelector:withObject:afterDelay:?
- Subject: Re: Thread Safety of performSelector:withObject:afterDelay:?
- From: Julien Jalon <email@hidden>
- Date: Wed, 23 Nov 2005 19:08:33 +0100
- NSRunloop instances are not thread-safe. In particular, using
performSelector:...afterDelay: with a runloop instance which is not
the current thread's runloop is not thread-safe at all
- CFRunLoop objects are thread-safe and is the good path to access
other thread's runloops
--
Julien
On 11/23/05, Jim Correia <email@hidden> wrote:
> In the thread safety summary at
>
> http://developer.apple.com/documentation/Cocoa/Conceptual/
> Multithreading/articles/CocoaSafety.html
>
> NSObject is listed as being thread safe. Does this mean that
>
> -[NSObject performSelector:withObject:afterDelay:]
>
> is also thread safe, even though the implementation surely involves
> the run loop, which isn't thread safe?
>
> Is the delayed invocation scheduled on the current run loop, or the
> main run loop?
>
> Finally, is there a built-in "Cocoa" way to determine if I am
> currently executing in the context of the main thread? Or must I
> write my own convenience wrapper for that test?
>
> Thanks,
> Jim
>
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Cocoa-dev mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden