Is it enough that just to have a HLT instruction in a loop?
Posted on 2003-10-06 09:12:44 by optimus
Hello optimismus!

With the api function SetPritory you are able to let the programm run as idle. - perhaps this helps you.

Bison-Boy forever
Posted on 2003-10-06 09:56:04 by BISON-BOY
Well... I've heard that Windows NT does not emulate the HLT instruction for Windows applications, but instead starts normal exception processing. Instead you should call Sleep with the parameter 0 to stop execution of the thread and have the system execute another thread.
Posted on 2003-10-06 11:28:02 by Sephiroth3

Well... I've heard that Windows NT does not emulate the HLT instruction for Windows applications, but instead starts normal exception processing. Instead you should call Sleep with the parameter 0 to stop execution of the thread and have the system execute another thread.


That's sounds like a very bad solution!

What I guess is to investigate your own threadcode and freze your programm.
At first i thought you want to peform runing you programm with the lowest priroty.
Use the Thread functions.:alright:

B I S O N - B O Y
Posted on 2003-10-06 12:52:46 by BISON-BOY
You may want to look at cpIce112.zip at http://win32asm.cjb.net/

I believe this will provide what you want.

Regards, P1 :cool:
Posted on 2003-10-06 12:54:21 by Pone
Can't open this site. :(


You may want to look at cpIce112.zip at http://win32asm.cjb.net/

I believe this will provide what you want.

Regards, P1 :cool:
Posted on 2003-10-06 21:33:55 by optimus
What's does your "emulate" mean? Windows NT emulate instructions?


Well... I've heard that Windows NT does not emulate the HLT instruction for Windows applications, but instead starts normal exception processing. Instead you should call Sleep with the parameter 0 to stop execution of the thread and have the system execute another thread.
Posted on 2003-10-06 21:35:15 by optimus
win2k/xp/nt has a system idle service which does a hlt instruction you can see it a lot if you popup softice in explorer or what not (hal.dll export HalProcessorIdle its basically a hlt then a ret) .. to have your process only be executed when the cpu is idle just use setthreadpriority with the idle priority parameters.. the hlt instruction is indeed 'forbidden' in win2k/xp/nt (at least in ring 3 is is).. so you wont be able to use it
Posted on 2003-10-06 23:54:39 by evlncrn8
HLT is a privileged instruction - the reason it works on 9x is that 9x catches the exception and emulates it, just like it does for som in/out port i/o.

What do you mean about "CPU idling", btw? Stuff like the CPUIdle and waterfall (or whatever) apps? On NT, they are sort of superfluous, since the idle-loop (as already said by others) does a HLT. There's other tricks that can be done too, though, especially on those quirky AMD systems - some pretty chipset specific stuff, disconnecting one of the "bridges" or something like that.
Posted on 2003-10-09 16:26:13 by f0dder

Can't open this site. :(



http://win32assembly.online.fr/files/cpIce112.zip

cjb.net is forbidden in China.
Posted on 2003-10-09 20:13:15 by KomsBomb