Re: threads vs run-loops for keeping your GUI responsive
Re: threads vs run-loops for keeping your GUI responsive
- Subject: Re: threads vs run-loops for keeping your GUI responsive
- From: Scott Ellsworth <email@hidden>
- Date: Fri, 09 Dec 2005 14:37:11 -0800
On Dec 9, 2005, at 1:53 PM, Niko Matsakis wrote:
As I said in my mail, I think in many cases a worker thread or
process is overkill. Sticking with one thread and one process can
be the simplest solution to get correct while still preventing long
freezes in the UI --- and that is the most important thing to me.
This is true, but remember that it leaves three quarters of the
potential processing power of a quad g5 on the floor. Sensible
partitioning of cpu intensive tasks can really help your app fly on
current desktop systems, and upcoming multicore powerbooks.
All of my apps start life as a single thread running on the main
event queue. Once I find any work that pegs the cpu for a thirtieth
of a second or more, I start trying to get stuff off the main thread,
whether by a separate process, a thread, or a better algorithm.
(And if there is no good partitioning, a single worker thread
updating the ui once done might be the best I can do in the time and
budget I have.)
As you say, each teqnique has a role, and each also has a cost in
developer and maintainer time. The tradeoff is different for a
scientific analysis app that takes a day to run, vs a throwaway eye
candy app that only has to run once per user.
Scott
_______________________________________________
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