Re: [Win32Lib] w32HIdle eating up CPU time

new topic     » goto parent     » topic index » view thread      » older message » newer message

Derek wrote:
> Firstly, 100% CPU is not a bad thing, so long as its not slowing other apps
> down.

It does slow down other apps. I am getting choppy music playback, although
the player (Buzz) normally uses 5-8% CPU time. I guess this happens when
the player needs some more CPU time (filling buffer), but EXW is occupying
all remaing CPU time and OS must reschedule....

Also, 100% CPU usage might be a problem for those wanting to keep their CPUs
cool or save energy. I have CPU usage always 100% (Seti@home - check Euphoria
Programming Language team), but notebook owners do not want to. Modern CPUs
(Pentium MMX)
have 'hlt' instruction that can be used to turn off the CPU for a cycle and thus
cooling it down and saving energy. (The OS must support it - generate 'hlt' in
idle
loop - Linux 2.4 and perhaps Win2000) Some mobile CPUs can also slow down its
working frequency (Transmeta) according to CPU usage.

> But anyhow, I've changed it now so that initially the w32HIdle event never
> happens (that is the library does not do idle checking). If your application
> needs to do this, it will have to call setIdle(True) first.  You can always
> setIdle(False) to turn it off again.

That is good for me. Probably the best solution would be to create a separate
w32HIdle thread with the lowest possible priority. But that is not possible with
Eu...

> BTW, thanks for the bug fix in bkgnd16.exw

Regards,
    Martin

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu