Partager via


Thread Scheduling Timers

The kernel's thread scheduling algorithm is closely related to power management as most devices are very sensitive to power consumption. The kernel calls OEMIdle whenever no threads are ready to run. The job of OEMIdle is to put the CPU into a low-power state until one of the following events occurs:

  • An interrupt wakes the system.
  • A thread is ready to be scheduled.

In practice, many devices spend most of their time waiting for input from the user. As a result, they will spend a great deal of time in OEMIdle.

When the system is not idle, threads are using the CPU to do work and OEMIdle is not called. Instead, a thread timer goes off periodically to update the system time and invoke the kernel's scheduler. When thread context switches occur, the currently running thread is interrupted by the timer, its context is saved, and another thread's context is restored when the timer ISR returns.

See Also

Kernel Scheduler

Last updated on Wednesday, April 13, 2005

© 2005 Microsoft Corporation. All rights reserved.