Chapter 3 Introduction to MR308
- 21 -
to the ready queue 13 is placed in the RUNNING state.
A currently executed task has normally terminated itself.14
A currently executed task has placed itself in the WAITING state.15
A currently executed task has changed its own priority so that the priority of a different READY
task is rendered higher.16
Due to interruption or other event occurrence, the priority of a currently executed task has been
changed so that the priority of a different READY task is rendered higher.17
When the ready queue of the issuing task priority is rotated by the rot_rdq or irot_rdq service call
and control of execution is thereby abandoned
3. WAITING state
When a task in the RUNNING state requests to be placed in the WAITING state, it exits the RUNNING
state and enters the WAITING state. The WAITING state is usually used as the condition in which the
completion of I/O device I/O operation or the processing of some other task is awaited.
The task goes into the WAITING state in one of the following ways.
The task enters the WAITING state simply when the slp_tsk service call is issued. In this case, the
task does not go into the READY state until its WAITING state is cleared explicitly by some other
task.
The task enters and remains in the WAITING state for a specified time period when the dly_tsk
service call is issued. In this case, the task goes into the READY state when the specified time has
elapsed or its WAITING state is cleared explicitly by some other task.
The task is placed into WAITING state for a wait request by the wai_flg, wai_sem, rcv_mbx,
snd_dtq, rcv_dtq, vsnd_dtq, vrcv_dtq, or get_mpf service call. In this case, the task goes from
WAITING state to READY state when the request is met or WAITING state is explicitly canceled
by another task.
The tslp_tsk, twai_flg, twai_sem, trcv_mbx, tsnd_dtq, trcv_dtq, vtsnd_dtq, vtrcv_dtq, and tget_mpf
service calls are the timeout-specified versions of the slp_tsk, wai_flg, wai_sem, rcv_mbx, snd_dtq,
rcv_dtq, vsnd_dtq, vrcv_dtq, and get_mpf service calls. The task is placed into WAITING state for
a wait request by one of these service calls. In this case, the task goes from WAITING state to
READY state when the request is met or the specified time has elapsed.
If the task is placed into WAITING state for a wait request by the wai_flg, wai_sem, rcv_mbx,
snd_dtq, rcv_dtq, vsnd_dtq, vrcv_dtq, get_mpf, twai_flg, twai_sem, trcv_mbx, tsnd_dtq, trcv_dtq,
vtsnd_dtq, vtrcv_dtq, or tget_mpf service call18, the task is queued to one of the following waiting
queues depending on the request.
Event flag waiting queue
Semaphore waiting queue
Mailbox message reception waiting queue
Data queue data transmission waiting queue
Data queue data reception waiting queue
Short data queue data transmission waiting queue
Short data queue data reception waiting queue
Fixed-size memory pool acquisition waiting queue
13 For the information on the ready queue,see the next chapter.
14 Depends on the ext_tsk service call.
15 Depends on the dly_tsk, slp_tsk, tslp_tsk, wai_flg, twai_flg, wai_sem, twai_sem, rcv_mbx, trcv_mbx,snd_dtq,tsnd_dtq,rcv_dtq, trcv_dtq,
vtsnd_dtq, vsnd_dtq,vtrcv_dtq,tget_mpf, get_mpf or vrcv_dtq service call.
16 Depends on the chg_pri service call.
17 Depends on the ichg_pri service call.
18 The service call twai_flg, twai_sem, and trcv_msg are included.