Re: Alternative to Delay()
Re: Alternative to Delay()
- Subject: Re: Alternative to Delay()
- From: Pete Gontier <email@hidden>
- Date: Tue, 29 Jul 2003 14:51:13 -0700
On Tuesday, Jul 29, 2003, at 12:53 US/Pacific, Brian Willoughby wrote:
...despite the official documented recommendation, a loop calling
TrackMouseLocation is still not the nicest coding technique in terms of
multi-processing and user interaction. Such a loop simplifies the
programmers job, but does not always use the CPU efficiently. As a
rule, any time the code is looping while polling for a change in
state, this code is wasting some amount of CPU.
I'd put good money down that a TrackMouseLocation loop is actually more
efficient, in terms of CPU usage, than a state machine driven by an
application framework's full-bore event dispatcher. App frameworks
block waiting for events. A more limited and thus simpler code path
into and out of blockage is almost certain to be more efficient.
Frameworks contain instructions, too.
Of course, in some situations, running the framework dispatcher will be
better for the user, but that does not seem to be the issue here. I
take "for those cases where I want to keep things simple" to mean "I've
already determined that the user doesn't need to touch any other part
of my app."
--
Pete Gontier
http://www.m-audio.com/
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.