Thread Priorities

In Windows, the priority of each thread is determined by the following criteria:

The priority class and priority level are combined to form the base priority of a thread.

The eRTOS environment has no process priority classes, so the threads of all processes affinity to the same CPU compete for the CPU using the thread priority only. Each processor has a priority-based ready queue, which guarantees that threads execute in priority order and in "first in, first out" order within any single priority. If a time quantum is set to 0, the thread will run to completion. If the time quantum is set to any other value, the thread will run for the specified time and then give up the CPU to another thread with the same priority.

Execution Environment

eRTOS scheduling allows threads to execute at any one of 128 real-time priorities, 0 to 127, where 127 is highest priority and 0 is the lowest. By default, all Process threads are created with a priority of 0. This can be changed using the API calls RtSetThreadPriority.

Related topics: