Chapter 3 Introduction to MR308
- 22 -
4. SUSPENDED state
When the sus_tsk system call is issued from a task in the RUNNING state or the isus_tsk system call
is issued from a handler, the READY task designated by the system call or the currently executed task
enters the SUSPENDED state. If a task in the WAITING state is placed in this situation, it goes into the
WAITING-SUSPENDED state.
The SUSPENDED state is the condition in which a READY task or currently executed task19 is ex-
cluded from scheduling to halt processing due to I/O or other error occurrence. That is, when the sus-
pend request is made to a READY task, that task is excluded from the execution queue.
Note that no queue is formed for the suspend request. Therefore, the suspend request can only be
made to the tasks in the RUNNING, READY, or WAITING state.20 If the suspend request is made to a
task in the SUSPENDED state, an error code is returned.
5. WAITING-SUSPENDED
If a forcible wait request is issued to a task currently in a wait state, the task goes to a WAIT-
ING-SUSPENDED state. If a forcible wait request is issued to a task that has been placed into a wait
state for a wait request by the slp_tsk, wai_flg, wai_sem, rcv_mbx, snd_dtq, rcv_dtq, vsnd_dtq,
vrcv_dtq, get_mpf, tslp_tsk, twai_flg, twai_sem, trcv_mbx, tsnd_dtq, trcv_dtq, vtsnd_dtq, vtrcv_dtq, or
tget_mpf service call, the task goes to a dual-wait state.
When the wait condition for a task in the WAITING-SUSPENDED state is cleared, that task goes into
the SUSPENDED state. It is conceivable that the wait condition may be cleared, when any of the fol-
lowing conditions occurs.
The task wakes up upon wup_tsk, or iwup_tsk service call issuance.
The task placed in the WAITING state by the dly_tsk or tslp_tsk service call wakes up after the
specified time elapse.
The request of the task placed in the WAITING state by the wai_flg , wai_sem, rcv_mbx, snd_dtq,
rcv_dtq, vsnd_dtq, vrcv_dtq, get_mpf, tslp_tsk, twai_flg, twai_sem, trcv_mbx, tsnd_dtq, trcv_dtq,
vtsnd_dtq, vtrcv_dtq, or tget_mpf service call is fulfilled.
The WAITING state is forcibly cleared by the rel_wai or irel_wai service call
When the SUSPENDED state clear request21 is made to a task in the WAITING-SUSPENDED state,
that task goes into the WAITING state. Since a task in the SUSPENDED state cannot request to be
placed in the WAITING state, status change from SUSPENDED to WAITING-SUSPENDED does not
possibly occur.
6. DORMANT
This state refers to the condition in which a task is registered in the MR308 system but not activated.
This task state prevails when either of the following two conditions occurs.
The task is waiting to be activated.
The task is normally terminated22 or forcibly terminated.23
19 If the task under execution is placed into a forcible wait state by the isus_tsk service call from the handler, the task goes from an execut-
ing state directly to a forcible wait state. Please note that in only this case exceptionally, it is possible that a task will go from an executing
state directly to a forcible wait state.
20 If a forcible wait request is issued to a task currently in a wait state, the task goes to a dual-wait state.
21 rsm_tsk or irsm_tsk service calls
22 ext_tsk service call
23 ter_tsk service call