OIC you are correct, i thought you were doing a lenghy calculation,
not waiting, sorry i misread. yes if you're just waiting, doing no
work, then MPYield or some such is certainly called for.
On May 23, 2008, at 11:42 PM, Uli Kusterer wrote:
Am 24.05.2008 um 08:03 schrieb David M. Cotter:
then again, there really is no need at all to "yield" on a
preemptive thread. loop away doing your calculation, the process
manager makes sure you don't starve other threads.
yielding is only an issue on cooperative threads
Well, not quite true. If you're spinning in a busy loop, you're
eating more CPU cycles than you'd need to. Most other APIs take a
delay for how long you want your thread to sleep, which means the
scheduler can do a much better job because it knows your thread
won't need cycles until that time has gone by.
In a busy loop, you'll get the maximum number of cycles the
scheduler can give you, and that means you'll be eating battery time
on Notebook computers like mad.
Cheers,
-- Uli Kusterer
"The Witnesses of TeachText are everywhere..."
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Carbon-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/carbon-dev/email@hidden