1.3.7. Task management¶
Each task in the runtime system has a specified logical priority. This priority is separated into the following 8 task segments, each with 31 priorities to categorize tasks:
Usage |
Defines |
Priority |
|---|---|---|
Task segment 1 For system tasks like scheduler |
TASKPRIO_SYSTEM_BASE |
0 |
TASKPRIO_SYSTEM_END |
31 |
|
Task segment 2 For real time tasks like IEC-tasks |
TASKPRIO_REALTIME_BASE |
32 |
TASKPRIO_REALTIME_END |
63 |
|
Task segment 3 High priority tasks like high prior communication tasks |
TASKPRIO_HIGH_BASE |
64 |
TASKPRIO_HIGH_END |
95 |
|
Task segment 4 Above normal tasks |
TASKPRIO_ABOVENORMAL_BASE |
96 |
TASKPRIO_ABOVENORMAL_END |
127 |
|
Task segment 5 Normal priority tasks like standard communication task |
TASKPRIO_NORMAL_BASE |
128 |
TASKPRIO_NORMAL_END |
159 |
|
Task segment 6 Below normal tasks |
TASKPRIO_BELOWNORMAL_BASE |
160 |
TASKPRIO_BELOWNORMAL_END |
191 |
|
Task segment 7 Low task priorities. |
TASKPRIO_LOW_BASE |
192 |
TASKPRIO_LOW_END |
223 |
|
Task segment 8 Lowest task priorities for background tasks. |
TASKPRIO_LOWEST_BASE |
224 |
TASKPRIO_LOWEST_END TASKPRIO_IDLE TASKPRIO_MIN |
255 |
So each task priority should be assigned to one of these 8 task segments.

