Re: Asynchronous Notification Does NOT Work
Re: Asynchronous Notification Does NOT Work
- Subject: Re: Asynchronous Notification Does NOT Work
- From: Bing Li <email@hidden>
- Date: Mon, 06 Jun 2011 03:45:21 +0800
Dear Jens,
Thanks so much for your reply!
But I have not got a tutorial that I can follow to program RunLoop. So I
decide to use threading and signal/wait to control threads. Is it fine?
In this case, notification might occur among two threads and both of them
are not the main thread. I think I can use synchronous notification and
threading together to replace asynchronous notification. How to you think
about that?
Best regards,
Bing
On Mon, Jun 6, 2011 at 3:34 AM, Jens Alfke <email@hidden> wrote:
>
> On Jun 5, 2011, at 11:59 AM, Bing Li wrote:
>
> > One issue is that the notification job is done in a thread I created
> explicitly. It is the potential reason? I will test it.
>
> Oh, that would do it. The notifications are going to be queued on that
> thread’s runloop then. Did you create a runloop for it, and did you want the
> notifications to be delivered on that thread, instead of the main thread?
>
> If you just want a background thread to post an action to the main thread,
> it’s pretty easy to use -performSelectorOnMainThread:.
>
> —Jens
_______________________________________________
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