Hello, welcome back.
In this lesson, we shall talk a bit more about the task blocked state so.
Two things causes a task to enter the blog stage.
This may be due to a time related event or a synchronization event, and what we mean by a time related
event is the task being asked to be told to go to the blocked state for a particular duration of time.
A synchronization event could be the task waiting for a signal from another task before you would move
on or continue with its work.
So it goes into the blocks.
Need to wait for the signal.
OK, let's see this diagram here.
This diagram shows us that when we are in the running state and we call one of the blocking APIs or
functions, our task would move to the blocked state.
The block in a block is associated, like we said, with a time event or synchronization event.
So when that particular event occurs, our task will transition from the blocked state to the already
state.
OK, now let's see how we'll be using the blocked state to create delays, there was dysfunction in
free Archos known as the V task delay.
To use this function, we have to go to our three Arktos config file and set include underscore V task
delay to one.
Dysfunction takes us argument, the the amount of ticks to delay the arguments, the number of tick
interrupt, that the calling task will remain in the blocked state before being transitioned back into
the ready state.
But, of course, using the amount of tick interrupts, it's not very intuitive because of that there
is this macro here known as PDM Static's and this micro Korvettes at times specified in milliseconds
into a time in ticks such that when we want to delay for one hundred milliseconds, we can just see
V task delay.
And as arguments we use the micro CDMS tactics and pass one hundred to PDM Static's.
So PDM extra takes would give us the tick equivalent of one hundred milliseconds and by so doing we
end up with a delay amount of one hundred times.
OK, so this order is on, on using the blocked state to create delays which will go on to try this
in code, but it needs to be pointed out in theory first.
I'll see you later.
Have a nice day.