Re: [newbie:] elegant way using multithreading with NSThreads
Re: [newbie:] elegant way using multithreading with NSThreads
- Subject: Re: [newbie:] elegant way using multithreading with NSThreads
- From: Dustin Voss <email@hidden>
- Date: Sun, 13 Mar 2005 13:07:11 -0800
On 12 Mar, 2005, at 8:12 PM, Wolfgang Maehr wrote:
I want my (command-line) App having multiple threads:
Main thread shall be a controller thread waiting for commands and
forwarding these to the appropriate objects to set options, start and
stop, and so on. Like a controller for a kernel. This controller
object (in thread 1) has a tracker object (that tracks the mouse
location), which shall be doing the tracking in a separate thread to
get enough performance. This splitting I can do with the [NSThread
detachNewThreadSelector:...] method, which lets thread loop in now in
a tracking loop. This loop also checks from time to time, if there are
new steering commands (in my message queue) to process and processes
these when needed.
A better way to do bi-directional thread communication than Distributed
Objects, is the InterThreadCommunication library. See
http:/www.cocoadev.com/?InterThreadCommunication.
_______________________________________________
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