Thread Scheduling Timers (Windows CE 5.0)
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 timer interrupts the currently running thread, the thread context is saved, and another thread's context is restored when the timer ISR returns.
See Also
Kernel Scheduler | Debugging and Testing
Send Feedback on this topic to the authors