Re: Best way to push action from 1 thread to another?
Re: Best way to push action from 1 thread to another?
- Subject: Re: Best way to push action from 1 thread to another?
- From: Mike Laster <email@hidden>
- Date: Thu, 09 May 2002 10:37:47 -0400
On 5/9/02 12:44 AM, "Cryx" <email@hidden> wrote:
>
Try using true notifications sent via a notification center. The
>
receiver is hooked nicely into your event loop, ala what you are doing
>
now. It's probably more efficient, but it's at a minimum far fewer
>
lines of code and more maintainable.
Did NSNotificationCenter change? The last time I looked at it, it wasn't
hooked into the run loop. Whenever a notification was posted, the callout
to registered listeners was executed in the context of the thread that
posted the message, which is not necessarily the thread of the listener.
This would make it useless for getting around AppKit thread safety issues,
since if you registered a listener in your main thread (the one you can
safely call AppKit from), your handler code could be executed in a different
thread context, and still not be allowed to talk to AppKit.
_______________________________________________
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.