Re: Threads, messages and blocking
Re: Threads, messages and blocking
- Subject: Re: Threads, messages and blocking
- From: Sean Harding <email@hidden>
- Date: Thu, 29 May 2003 15:26:39 -0700
On Thu May 29 at 11:07:57 PM, Tom Sutcliffe wrote:
>
Short answer: in the second thread, you probably want to call
>
NSObject's performSelectorOnMainThread.
>
>
Long answer: It depends on what work you want thread 1 to be able to do
>
while thread 2 is running, and what thread 1 actually is. If it is the
>
main application thread, then you use performSelectorOnMainThread,
>
which is Cocoa's way of doing callbacks. Thread 1 can continue to run
Yes, thread 1 is the main application thread. performSelectorOnMainThread
looks like it could help. But I'm not sure it will completely solve the
problem. Sometimes I'll have thread 2 idle while thread 1 does unrelated
stuff, and then thread 1 will need it to do something.
performSelectorOnMainThread only allows communication thread 2->thread 1
(main thread), it appears. So it doesn't give me any way to have the main
thread send thread 2 another "go to work" message. Am I misunderstanding the
suggestion?
Thanks.
sean
--
Sean Harding -- email@hidden --
http://dogcow.org/s/ -- KD7UAY
Seattle, WA, USA
_______________________________________________
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.