Chapter 3 Introduction to MR308
- 32 -
3.5.3 Task Management Function
The task management function is used to perform task operations such as task start/stop and task priority up-
dating. The MR308 kernel offers the following task management function service calls.
• Activate Task (act_tsk, iact_tsk)
Activates the task, changing its status from DORMANT to either READY or RUNNING. In this service
call, unlike in sta_tsk(ista_tsk), startup requests are accumulated, but startup code cannot be speci-
fied.
• Activate Task (sta_tsk, ista_tsk)
Activates the task, changing its status from DORMANT to either READY or RUNNING. In this service
call, unlike in act_tsk(iact_tsk), startup requests are not accumulated, but startup code can be speci-
fied.
• Terminate Invoking Task (ext_tsk)
When the issuing task is terminated, its state changes to DORMANT state. The task is therefore not
executed until it is restarted. If startup requests are accumulated, task startup processing is performed
again. In that case, the issuing task behaves as if it were reset.
If written in C language, this service call is automatically invoked at return from the task regardless of
whether it is explicitly written when terminated.
• Terminate Task (ter_tsk)
Other tasks in other than DORMANT state are forcibly terminated and placed into DORMANT state. If
startup requests are accumulated, task startup processing is performed again. In that case, the issuing
task behaves as if it were reset. (See Figure 3.20).
TaskA
TaskB
ter_tsk(B)
Task B reset
Terminated
Startup request count > 0
Figure 3.20 Task Resetting
• Change Task Priority (chg_pri, ichg_pri)
If the priority of a task is changed while the task is in READY or RUNNING state, the ready queue also
is updated. (See Figure 3.21).
Furthermore, if the target task is placed in a waiting queue of objects with TA_TPRI attribute, the wait-
ing queue also is updated. (See Figure 3.22).