
B–61863E–1/06
2. TASK CONTROL FUNCTION
PMC CONTROL SOFTWARE
59
Every task belongs to one of the states shown in the figure below. The
task state can be changed by a system call (mentioned later).
State transition between the running state and ready state occurs
automatically as the PMC control software selects a highest-priority task.
Transition from the stop state to the ready state is made by the PMC
control software when the power is turned on.
Release of event waiting
Running state
(RUNNING)
Ready state
(READY)
Stop state
(STOP)
Wait state
(WAITING)
Waiting for an event
At power–up
Return from the
entry function
(1) Stop state
A task is in a stopped state.
If control is returned from the entry function of a task, that task is
placed in the stop state indefinitely.
(2) Ready state
Although a request to activate a task has been made, the task is
waiting for execution because a task having a higher priority exists.
A task waiting for an event such as timer expiration or a semaphore
is placed in the ready state when the event wait state is released.
When a running task has to wait for an event or the priority of the
running task becomes lower than a task in the ready state, the task in
the running state is placed in the ready state, and the task having the
highest priority among the ready tasks starts running.
(3) Running state
A task is being performed by the processor.
When a running task has to wait for an event such as timer expiration
or a semaphore, it enters the wait state.
More than one task does not enter the running state at the same time.
(4) Wait state
A task is waiting for an event. By placing a running task in the wait
state, a lower-priority task can be performed.
When the lower-priority task is released from the event wait state, the
task placed in the wait state enters the ready state again.
Events that may be awaited include:
D Timer expiration
D Event flag
D Semaphore signal
D Mailbox read/write
D Packet reception
2.5
TASK STATES