IEEE Std 2050-2018
IEEE Standard for a Real-Time Operating System (RTOS) for Small-Scale Embedded Systems
9
Copyright © 2018 IEEE. All rights reserved.
Table 1 —State transitions distinguishing invoking task and other tasks
Operations in invoking tasks
(transition from RUNNING state)
Operations on other tasks
(transitions from other states)
Task transition to a waiting state
(including SUSPENDED)
RUNNING state
→ WAITING state
READY state, WAITING state
→ SUSPENDED state,
Task exit
RUNNING state
READY state, WAITING state
Task deletion
RUNNING state
DORMANT state
NOTE 1— WAITING state and SUSPENDED state are orthogonally related, in that a request for transition to
SUSPENDED state cannot have any effect on the conditions for task wait release. That is, the task wait release
conditions are the same whether the task is in WAITING state or WAITING-SUSPENDED state. Thus, even if
transition to SUSPENDED state is requested for a task that is in a state of waiting to acquire some resource (semaphore
resource, memory block, etc.), and the task goes to WAITING-SUSPENDED state, the conditions for allocation of the
resource do not change but remain the same as before the request to go to SUSPENDED state.
1
NOTE 2— The reason the μT-Kernel makes a distinction between WAITING state (wait caused by the invoking task)
and SUSPENDED state (wait caused by another task) is that these states sometimes overlap. By recognizing these
overlapped states as WAITING-SUSPENDED states, the task state transitions become clearer and system calls are
easier to understand. On the other hand, since a task in WAITING state cannot invoke a system call, different types of
WAITING state (e.g., waiting for wakeup, or waiting to acquire a semaphore resource) will never overlap. Since there
is only one kind of waiting state caused by another task (SUSPENDED state), the μT-Kernel treats repeated entries to
SUSPENDED state as nesting, thereby achieving clarity of task state transitions.
3.2.2 Task scheduling rules
The μT-Kernel adopts a preemptive priority-based scheduling method based on priority levels assigned to
each task. Tasks having the same priority are scheduled on a FCFS (first come first served) basis.
Specifically, task precedence is used as the task scheduling rule, and precedence among tasks is determined
as follows based on the priority of each task. If there are multiple tasks that can be run, the one with the
highest precedence goes to RUNNING state and the others go to READY state. In determining precedence
among tasks, of those tasks having different priority levels, that with the highest priority has the highest
precedence. Among tasks having the same priority, the one that entered runnable states (RUNNING state or
READY state) first has the highest precedence. It is possible, however, to use a system call to change the
precedence among tasks having the same priority.
When the task with the highest precedence changes from one task to another, a dispatch occurs
immediately and the task in RUNNING state is switched. If no dispatch occurs (during execution of a
handler, during dispatch disabled state, etc.), however, the switching of the task in RUNNING state is held
off until the next dispatch occurs.
3.2.2.1 Additional notes and examples for task scheduling rules
According to the scheduling rules adopted in the μT-Kernel, so long as there is a higher precedence task in
runnable states, a task with lower precedence will simply not run. That is, unless the highest-precedence
task goes to WAITING state or for other reason cannot run, other tasks are not run. This is a fundamental
difference from TSS (time sharing system) scheduling in which multiple tasks are treated equally.
1
Notes in text, tables, and figures of a standard are given for information only and do not contain requirements needed to implement
this standard.
Authorized licensed use limited to: UNIVERSITY OF KENTUCKY. Downloaded on August 27,2018 at 16:14:07 UTC from IEEE Xplore. Restrictions apply.