Re: Behaving "nice"(1) in the background
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