Hello, welcome back.
In this lesson, we shall take a look at the various states in which a task can exist in the real outer
and the free orators Real-Time Operating System.
We have this diagram here showing a number of arrows.
These arrows indicate the directions that we can move to from a particular point in the center.
We have the ready states.
A task in the ready states can move to the running states, in the red states, a task does not execute,
is just waiting for the scheduler to execute it.
The red states means the task is ready to run.
You can think of run as executing so often when we run in our tasks, they all exist in the ready states
waiting for their turn in the red states.
We can move to the running states that run in status.
When our task has the Processo and is currently executing the content of its task function or its task
code, we can move from the running state back to the ready states.
For instance, if we are running a round robin scheduling, when we when we see each task should execute
for, say, ten milliseconds, let's say the current task.
Is executing after ten milliseconds, you go back to the ready states and then the next task will move
from the red state to the running states.
We also have the block states.
The block states is when a task is waiting for a particular event to occur.
The event could be less waiting for a semaphore to occur, and sometimes it could be a delay.
We could see let this task delay for this amount of time.
And often delay is known as sleep.
Let it task go to sleep for 50 TM's.
So we can move from our running state to the block states and when the event or whether it's a time
together event or another event, such as a resource such as a SEMAFO and a semaphore, you can think
of a SEMAFO as a key.
Tzatziki becomes available.
Then we can move from the block state to the red state for our turn to run again.
So does the block state.
And from the block states, we can call a function functional, nice v task, so spend.
To suspend a task and the task will go to the suspended state.
And from the suspended state, we can move to the red states.
OK.
And then from the former running states, we can suspend our task as well.
There is a function called V task, so spend, we can just call V task, suspend and go to suspend states.
If we want to suspend a task, resume it.
We call the V task resume and come over here.
Right.
OK, so this is the the task states this a simplified diagram of the task states we start over here.
That is why the red mark is over here.
We start from the red states and then red states.
We automatically go to the Iranian states.
You would see that with their snow function that moves us from red states to running states.
The threat switcher, the scheduler takes care of this movement.
But these are the movement these will depend on said in event that we set.
We call these the blocking apps, the set of functions that we define as the blocking API functions
when we call any of them will be moved to the block states, right.
OK, so this order is for this lesson on TASC states.
I'll see in the next lesson.