Difference between revisions of "Task Switching"
Line 2: | Line 2: | ||
In this tutorial we will be looking all the possible freeRtos configuration. | In this tutorial we will be looking all the possible freeRtos configuration. | ||
+ | =Task States= | ||
+ | |||
+ | In the FreeRTOS a task can be in either of four different states viz., Running, Ready, Blocked and Suspended as shown in below image. | ||
[[FILE:FreeRtos States.png]] | [[FILE:FreeRtos States.png]] | ||
+ | |||
+ | <b>1.Running</b>: The task which is executing currently is said to be in running state. It owns the CPU. | ||
+ | |||
+ | <b>2.Ready</b>: The task which is neither suspended nor blocked but still not executing will be ready state. Its not in running state because either a high priority or equal priority task is executing. | ||
+ | |||
+ | <b>3.Blocked</b>: A task will go in blocked state whenever its waiting for a event to happen. The event can be completing a delay period or availability of a resource. The blocked tasks are not available for scheduling. | ||
+ | |||
+ | <b>4.Suspended</b>: When vTaskSuspend() is called, the task goes in suspended state. To resume it, xTaskResume() is called. The suspended tasks are also not available for scheduling. |
Revision as of 16:18, 27 June 2016
In this tutorial we will be looking all the possible freeRtos configuration.
Task States
In the FreeRTOS a task can be in either of four different states viz., Running, Ready, Blocked and Suspended as shown in below image.
1.Running: The task which is executing currently is said to be in running state. It owns the CPU.
2.Ready: The task which is neither suspended nor blocked but still not executing will be ready state. Its not in running state because either a high priority or equal priority task is executing.
3.Blocked: A task will go in blocked state whenever its waiting for a event to happen. The event can be completing a delay period or availability of a resource. The blocked tasks are not available for scheduling.
4.Suspended: When vTaskSuspend() is called, the task goes in suspended state. To resume it, xTaskResume() is called. The suspended tasks are also not available for scheduling.