30
K
A
DAK
Application Tasks
3.4 Task Priority
Task priorities are used by the AMX Task Scheduler to determine which task to execute.
At all times, the task with the highest priority which is capable of execution will run.
A task's priority is defined at the time the task is created. Task priorities range from 0
(highest) to 255 (lowest). Priorities 0 and 128 to 255 inclusive are reserved for AMX
use. The AMX Kernel Task executes at priority 0 above all other tasks.
Application tasks can be assigned priorities 1 to 127 inclusive. Since the number of
priority levels exceeds the maximum number of possible tasks, it is evident that priority
levels do not have to be shared.
If more than one task is assigned the same priority, AMX will assign the tasks relative
priorities according to the chronological order in which they were created with the first
created task having the higher priority.
A task may change its priority or the priority of any other task. This practice is not
recommended however. Experience has shown that this facility is rarely required and all
too often is abused. The task's new priority remains in effect until you decide, if ever, to
change it again.