Chapter 3 Introduction to MR308
- 23 -
3.3.2 Task Priority and Ready Queue
In the real-time OS, several tasks may simultaneously request to be executed. In such a case, it is necessary to
determine which task the system should execute first. To properly handle this kind of situation, the system or-
ganizes the tasks into proper execution priority and starts execution with a task having the highest priority. To
complete task execution quickly, tasks related to processing operations that need to be performed immediately
should be given higher priorities.
The MR308 permits giving the same priority to several tasks. To provide proper control over the READY task
execution order, the system generates a task execution queue called "ready queue." The ready queue structure
is shown in Figure 3.1424 The ready queue is provided and controlled for each priority level. The first task in the
ready queue having the highest priority is placed in the RUNNING state.25
1TCB
Priority
2

TCBTCB

TCBTCB

TCB

3
n
Figure 3.14 Ready Queue (Execution Queue)
24 The TCB(task control block is described in the next chapter.)
25 The task in the RUNNING state remains in the ready queue.