• 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: Behaving "nice"(1) in the background
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Behaving "nice"(1) in the background


  • Subject: Re: Behaving "nice"(1) in the background
  • From: email@hidden
  • Date: Wed, 22 Feb 2006 15:07:10 -0800

You could use a low priority thread to do the work, use a low priority
task launched by your application, or break you work up into small
units that you can have your applications runloop run when idle or
when a timer fires.

Those are good ideas, but depending on what you're doing, may be superficial. If you're doing I/O, you have to worry about that far more than CPU scheduling. Focus on minimising I/O, and spreading it out evenly. Take .Mac syncing as an example of this done very wrong - very low CPU usage, even when syncing, but as soon as it starts syncing it thrashes the disk wildly. This will kill anything performance-critical. The worst thing is when playing a game full screen... you have to quit the game, kill the sync, then relaunch it again. Very sad state of affairs.


A similar thing applies, to a lesser degree, with network activity - some higher-level actions can cause quite a bit of activity, especially if things go wrong with the network. I'm talking about using high level APIs like the Security framework, WebKit, etc. Raw sockets shouldn't be an issue at all.

Wade
_______________________________________________
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


  • Follow-Ups:
    • Re: Behaving "nice"(1) in the background
      • From: "Alexander von Below" <email@hidden>
References: 
 >Behaving "nice"(1) in the background (From: "Alexander von Below" <email@hidden>)
 >Re: Behaving "nice"(1) in the background (From: "Shawn Erickson" <email@hidden>)

  • Prev by Date: Re: Behaving "nice"(1) in the background
  • Next by Date: JNI and JVM Version
  • Previous by thread: Re: Behaving "nice"(1) in the background
  • Next by thread: Re: Behaving "nice"(1) in the background
  • Index(es):
    • Date
    • Thread