embOS实时操作系统 - 任务状态

A task may be in one of several states at any given time. When a task is created, it is placed into the READY state.

A task in the READY state is activated as soon as there is no other task in the READY state with higher priority.

Only one task may be running at a time.

If a task with higher priority becomes READY, this higher priority task is activated and the preempted task remains in the READY state.

The running task may be delayed for or until a specified time;

in this case it is placed into the WAITING state
and the next-highest-priority task in the READY state is activated.

The running task might need to wait for an event (or semaphore, mailbox or queue). 

If the event has not yet occurred, the task is placed into the waiting state
and the next-highest-priority task in the READY state is activated.

A non-existent task is one that is not yet available to embOS; it either has been terminated or was not created at all.

The following illustration shows all possible task states and transitions between them.

posted @ 2015-08-06 11:11  IAmAProgrammer  阅读(712)  评论(0编辑  收藏  举报