Re: Simple message passing between threads
Re: Simple message passing between threads
- Subject: Re: Simple message passing between threads
- From: Douglas Davidson <email@hidden>
- Date: Fri, 22 Jun 2001 10:29:31 -0700
On Thursday, June 21, 2001, at 05:04 PM, Clyde McQueen wrote:
I guess I'll second the question - everything I've read has suggested
that a single NSConditionLock is the easiest way to communicate between
threads. No DO, no events, etc. I'm going to give it a crack. Am I
barking up the wrong tree?
It depends on what kind of communication you want. An NSConditionLock
is great for letting one thread wait on another, and there are plenty of
circumstances where that is exactly what you need. However, the
questions here were about notifying the main thread when a background
thread has done something. In this case, you probably want your main
thread to keep running its run loop, and then get a message within that
run loop when something has happened on a background thread. That's why
we were speaking of DO etc.
Douglas Davidson