• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: threads vs run-loops for keeping your GUI responsive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
References: 
 >threads vs run-loops for keeping your GUI responsive (From: Niko Matsakis <email@hidden>)
 >Re: threads vs run-loops for keeping your GUI responsive (From: "Joshua D. Orr" <email@hidden>)
 >Re: threads vs run-loops for keeping your GUI responsive (From: Niko Matsakis <email@hidden>)

  • Prev by Date: Sqlite and formatters
  • Next by Date: Re: Using instance variable from NSArray of objects
  • Previous by thread: Re: threads vs run-loops for keeping your GUI responsive
  • Next by thread: Re: threads vs run-loops for keeping your GUI responsive
  • Index(es):
    • Date
    • Thread