Blocked

A Blocked task is a task that is waiting for something. There are two ways for a task to move out of the Blocked state: either an event will trigger a transition from Blocked to Ready for the task, or a timeout will occur, placing the task in the Ready state. 

This is a very important feature of an RTOS: each blocking call is time-bound. That is, a task will only block while waiting for an event for as long as the programmer specifies it can be blocked. This is an important distinction between RTOS firmware programming and general-purpose application programming. For example, an attempt to take a mutex that will fail if the mutex isn't available within the specified amount of time. The same is true for API calls that accept and push data onto queues, as well as all the other non-interrupt API calls in FreeRTOS.

While a task is in the Blocked state, it doesn't consume any processor time. When a task is transitioned out of the Blocked state by the scheduler, it will be moved to the Ready state, allowing the calling task to run when it becomes the highest priority task in the system.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.138.174.174