RTX166 Tiny User's Guide

Task Management

RTX166 Tiny implements a state machine to manage task scheduling. Each RTX166 Tiny task is always in exactly one state which tells the disposition of the task. The following diagram shows how tasks move from one state to another.

 

StateDescription
RunningThe task that is currently running is in the Running State. Only one task at a time may be in this state. The os_running_task_id routine returns the task number of the currently executing task.
ReadyTasks which are ready to run are in the Ready State. Once the Running task has completed processing and the MCU can begin running another task, RTX166 Tiny selects and starts the next Ready task.
WaitingTasks which are waiting for an event are in the Waiting State. Once the event occurs, the task is switched to the Ready State. The os_wait function is used to place a task in the Waiting State.
DeletedTasks which have not been started or tasks which have been deleted are in the Deleted State. The os_delete_task routine places a task that has been started (with os_create_task) into the Deleted State.
TimeoutTasks which were interrupted by a Round-Robin Time-Out are in the Timeout State. This state is equivalent to the Ready State.