Giving the CPU a break...
Giving the CPU a break...
- Subject: Giving the CPU a break...
- From: Buzz Andersen <email@hidden>
- Date: Mon, 18 Nov 2002 12:04:33 -0700
This is probably a terribly obvious rookie question, but I'll ask it
any way. A program I am working on contains a very tight loop that can
often run through many thousands of iterations at a time. As you might
expect, this is having a tendency to really max out my CPU usage and
make my computer very unresponsive.
My question is: is there a good way for me to give the CPU a break and
make the computer more responsive during this loop without compromising
performance significantly? I have tried moving my thread priority down
to 0.1, but that doesn't seem to make a difference. Would NSThread's
sleepUntilDate: methods be what I'm looking for? If so, how long do
you think I would need to sleep to really alleviate the problem without
compromising performance too much? Or, alternatively, is there a
better way to accomplish what I'm trying to do (this way seems a little
hacky to me)?
Thanks, as always, for everyone's expertise...
--
Buzz Andersen
email: email@hidden
web:
http://www.scifihifi.com
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.