Keil™, An ARM® Company

RTX51 Tiny User's Guide

Task Management

Each RTX51 Tiny task is always in exactly one state which tells the disposition of the task.

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 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, RTX51 Tiny selects and starts the next Ready task. A task may be made ready immediately (even if the task is waiting for a timeout or signal) by setting its ready flag using the os_set_ready or isr_set_ready functions.
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.
TIME-OUTTasks which were interrupted by a Round-Robin Time-Out are in the TIME-OUT State. This state is equivalent to the READY State for Round-Robin programs.