Re: Multithreaded Cocoa Document Application?
Re: Multithreaded Cocoa Document Application?
- Subject: Re: Multithreaded Cocoa Document Application?
- From: Seth Willits <email@hidden>
- Date: Thu, 23 Aug 2007 18:19:13 -0700
On Aug 23, 2007, at 5:56 PM, Rick Ekle wrote:
I'm trying to write an application that can open multiple files at
once and perform some potentially long processing on each. I'd like
to have each document open in a separate thread or process so that the
application can better take advantage of a multicore processor to
process multiple files simultaneously.
Any ideas?
The brief version:
Your document object should spawn a thread that does the processing.
When the processing is done, a signal is sent to whoever is listening
that the processing is done. Everything will happen in parallel and
all is yummy.
NSThread is just fine for this. You don't the thread to tell you to
know that it is running. Instead you just use a signal for when the
thread exits (there are many ways to do this) and you assume it's
running.
--
Seth Willits
_______________________________________________
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