Page 1 of 1
How to implement System Idle process
Posted: Fri May 21, 2004 5:10 pm
by amirsadig
I have notice that my OS eat alot of CPU, when I run it in VMWare (emulator). I think that because my process run a loop.
what the idea behind a system idle process (like in windows or linux). is it also a 100% loop? but with low priority. that mean the scheduler will run this proccess only if there is no others task.
please correct me if I wrong!
Re:How to implement System Idle process
Posted: Fri May 21, 2004 7:45 pm
by quaak
Use the cpu halt instruction in your idle loop.
Re:How to implement System Idle process
Posted: Sat May 22, 2004 6:32 am
by Brendan
Hi,
amirsadig wrote:
I have notice that my OS eat alot of CPU, when I run it in VMWare (emulator). I think that because my process run a loop.
what the idea behind a system idle process (like in windows or linux). is it also a 100% loop? but with low priority. that mean the scheduler will run this proccess only if there is no others task.
please correct me if I wrong!
On some OS's the kernel just uses HLT in a loop. More advanced OS's also use power management (ACPI, APM, CPU throttling, etc) to send things (and/or the entire computer) to sleep after certain time delays expire.
IMHO the OS should make as much use of idle time as possible, especially OS's designed for desktop use where the CPU is mostly used in bursts (ie. idle time should be used as much as possible to do anything that can improve performance when the CPU isn't idle).
For example, my OS uses idle time to clean physical memory pages, perform garbage collection on kernel data and check for bad/faulty memory in addition to HLT (and eventually power management).
Cheers,
Brendan