Книга: Microsoft Windows Embedded CE 6.0 Exam Preparation Kit

Thread Scheduling on Windows Embedded CE

Thread Scheduling on Windows Embedded CE

Windows Embedded CE supports preemptive multitasking to run multiple threads from various processes simultaneously. Windows Embedded CE performs thread scheduling based on priority. Each thread on the system has a priority ranging from zero to 255. Priority zero is the highest priority. The scheduler maintains a priority list and selects the thread to run next according to the thread priority in a round-robin fashion. Threads of the same priority run sequentially in a random order. It is important to note that thread scheduling relies on a time-slice algorithm. Each thread can only run for a limited amount of time. The maximum possible time slice that a thread can run is called the quantum. Once the quantum has elapsed, the scheduler suspends the thread and resumes the next thread in the list.

Applications can set the quantum on a thread-by-thread basis to adapt thread scheduling according to application needs. However, changing the quantum for a thread does not affect threads with a higher priority because the schedule selects threads with higher priority to run first. The scheduler even suspends lower-priority threads within their time slice if a higher-priority thread becomes available to run.

Оглавление книги


Генерация: 1.853. Запросов К БД/Cache: 3 / 0
поделиться
Вверх Вниз