Application Tasks
K
A
DAK
27
3.2 Task StatesA task is always in one of the following states:
Idle
Ready
Run
Wait
Halt
When a task is created, AMX assigns it a Task Control Block and sets it in the idle state.
An idle task has no outstanding requests to execute pending. It is waiting to be triggered.
A ready task has an outstanding request to execute or is ready to resume execution after
having been interrupted or waiting.
A task which is executing is the only task which is in the run state.
A task is in the wait state when it is blocked pending the occurrence of some event. The
wait state is always qualified with an indication in the TCB as to what the task is waiting
for.
The halt state is reserved for use by KADAK debug utilities to suspend all task execution
for debugging purposes.
The halt state is used by the AMX Breakpoint Manager to suspend all task execution
when a debug breakpoint is encountered. When a debug breakpoint is encountered, all
application tasks except the one in which the breakpoint occurred are placed in the halt
state. When you leave the debugger, the tasks are restored to the state they were in prior
to the breakpoint.
Figure 3.2-1 illustrates the task states and shows the state transitions which are possible.
The halt state is not explicitly shown.