1
00:00:01,680 --> 00:00:02,800
Hello, welcome back.

2
00:00:02,820 --> 00:00:07,500
In this lesson, we shall talk a bit more about the task blocked state so.

3
00:00:08,660 --> 00:00:11,780
Two things causes a task to enter the blog stage.

4
00:00:12,680 --> 00:00:19,070
This may be due to a time related event or a synchronization event, and what we mean by a time related

5
00:00:19,070 --> 00:00:27,290
event is the task being asked to be told to go to the blocked state for a particular duration of time.

6
00:00:27,830 --> 00:00:35,540
A synchronization event could be the task waiting for a signal from another task before you would move

7
00:00:35,540 --> 00:00:37,230
on or continue with its work.

8
00:00:37,250 --> 00:00:39,100
So it goes into the blocks.

9
00:00:39,110 --> 00:00:40,340
Need to wait for the signal.

10
00:00:41,740 --> 00:00:43,590
OK, let's see this diagram here.

11
00:00:45,250 --> 00:00:50,890
This diagram shows us that when we are in the running state and we call one of the blocking APIs or

12
00:00:50,890 --> 00:00:54,820
functions, our task would move to the blocked state.

13
00:00:56,510 --> 00:01:02,890
The block in a block is associated, like we said, with a time event or synchronization event.

14
00:01:03,230 --> 00:01:09,350
So when that particular event occurs, our task will transition from the blocked state to the already

15
00:01:09,380 --> 00:01:09,770
state.

16
00:01:11,280 --> 00:01:18,660
OK, now let's see how we'll be using the blocked state to create delays, there was dysfunction in

17
00:01:18,660 --> 00:01:21,150
free Archos known as the V task delay.

18
00:01:21,600 --> 00:01:29,490
To use this function, we have to go to our three Arktos config file and set include underscore V task

19
00:01:29,490 --> 00:01:30,390
delay to one.

20
00:01:31,680 --> 00:01:38,430
Dysfunction takes us argument, the the amount of ticks to delay the arguments, the number of tick

21
00:01:38,430 --> 00:01:44,280
interrupt, that the calling task will remain in the blocked state before being transitioned back into

22
00:01:44,280 --> 00:01:45,180
the ready state.

23
00:01:46,450 --> 00:01:52,510
But, of course, using the amount of tick interrupts, it's not very intuitive because of that there

24
00:01:52,510 --> 00:01:59,320
is this macro here known as PDM Static's and this micro Korvettes at times specified in milliseconds

25
00:01:59,560 --> 00:02:06,670
into a time in ticks such that when we want to delay for one hundred milliseconds, we can just see

26
00:02:06,670 --> 00:02:07,960
V task delay.

27
00:02:07,990 --> 00:02:14,350
And as arguments we use the micro CDMS tactics and pass one hundred to PDM Static's.

28
00:02:15,040 --> 00:02:22,540
So PDM extra takes would give us the tick equivalent of one hundred milliseconds and by so doing we

29
00:02:22,540 --> 00:02:25,450
end up with a delay amount of one hundred times.

30
00:02:26,710 --> 00:02:34,390
OK, so this order is on, on using the blocked state to create delays which will go on to try this

31
00:02:34,390 --> 00:02:37,720
in code, but it needs to be pointed out in theory first.

32
00:02:37,870 --> 00:02:38,730
I'll see you later.

33
00:02:38,740 --> 00:02:39,490
Have a nice day.
