1
00:00:00,890 --> 00:00:01,960
Hello, welcome back.

2
00:00:02,390 --> 00:00:10,220
In this lesson, we shall take a look at the various states in which a task can exist in the real outer

3
00:00:10,310 --> 00:00:12,990
and the free orators Real-Time Operating System.

4
00:00:13,340 --> 00:00:15,740
We have this diagram here showing a number of arrows.

5
00:00:15,740 --> 00:00:23,330
These arrows indicate the directions that we can move to from a particular point in the center.

6
00:00:23,360 --> 00:00:24,620
We have the ready states.

7
00:00:25,550 --> 00:00:32,150
A task in the ready states can move to the running states, in the red states, a task does not execute,

8
00:00:32,150 --> 00:00:35,960
is just waiting for the scheduler to execute it.

9
00:00:37,010 --> 00:00:40,040
The red states means the task is ready to run.

10
00:00:40,750 --> 00:00:48,170
You can think of run as executing so often when we run in our tasks, they all exist in the ready states

11
00:00:48,170 --> 00:00:50,830
waiting for their turn in the red states.

12
00:00:50,840 --> 00:00:53,330
We can move to the running states that run in status.

13
00:00:53,330 --> 00:01:01,470
When our task has the Processo and is currently executing the content of its task function or its task

14
00:01:01,500 --> 00:01:05,480
code, we can move from the running state back to the ready states.

15
00:01:05,570 --> 00:01:13,550
For instance, if we are running a round robin scheduling, when we when we see each task should execute

16
00:01:13,550 --> 00:01:16,640
for, say, ten milliseconds, let's say the current task.

17
00:01:18,000 --> 00:01:23,610
Is executing after ten milliseconds, you go back to the ready states and then the next task will move

18
00:01:23,610 --> 00:01:25,390
from the red state to the running states.

19
00:01:25,950 --> 00:01:27,360
We also have the block states.

20
00:01:27,780 --> 00:01:32,470
The block states is when a task is waiting for a particular event to occur.

21
00:01:33,610 --> 00:01:39,040
The event could be less waiting for a semaphore to occur, and sometimes it could be a delay.

22
00:01:39,070 --> 00:01:42,730
We could see let this task delay for this amount of time.

23
00:01:43,000 --> 00:01:45,220
And often delay is known as sleep.

24
00:01:45,220 --> 00:01:48,190
Let it task go to sleep for 50 TM's.

25
00:01:49,230 --> 00:01:54,450
So we can move from our running state to the block states and when the event or whether it's a time

26
00:01:54,450 --> 00:02:00,810
together event or another event, such as a resource such as a SEMAFO and a semaphore, you can think

27
00:02:00,810 --> 00:02:02,190
of a SEMAFO as a key.

28
00:02:02,670 --> 00:02:04,470
Tzatziki becomes available.

29
00:02:04,650 --> 00:02:09,550
Then we can move from the block state to the red state for our turn to run again.

30
00:02:09,840 --> 00:02:11,250
So does the block state.

31
00:02:12,430 --> 00:02:16,660
And from the block states, we can call a function functional, nice v task, so spend.

32
00:02:17,600 --> 00:02:20,960
To suspend a task and the task will go to the suspended state.

33
00:02:22,870 --> 00:02:25,810
And from the suspended state, we can move to the red states.

34
00:02:28,200 --> 00:02:28,740
OK.

35
00:02:30,030 --> 00:02:35,310
And then from the former running states, we can suspend our task as well.

36
00:02:36,270 --> 00:02:43,350
There is a function called V task, so spend, we can just call V task, suspend and go to suspend states.

37
00:02:43,500 --> 00:02:46,140
If we want to suspend a task, resume it.

38
00:02:46,140 --> 00:02:49,290
We call the V task resume and come over here.

39
00:02:50,250 --> 00:02:50,720
Right.

40
00:02:51,690 --> 00:02:58,820
OK, so this is the the task states this a simplified diagram of the task states we start over here.

41
00:02:58,860 --> 00:03:01,150
That is why the red mark is over here.

42
00:03:01,200 --> 00:03:05,070
We start from the red states and then red states.

43
00:03:05,070 --> 00:03:06,930
We automatically go to the Iranian states.

44
00:03:06,930 --> 00:03:11,580
You would see that with their snow function that moves us from red states to running states.

45
00:03:11,880 --> 00:03:16,190
The threat switcher, the scheduler takes care of this movement.

46
00:03:16,650 --> 00:03:23,310
But these are the movement these will depend on said in event that we set.

47
00:03:24,540 --> 00:03:29,760
We call these the blocking apps, the set of functions that we define as the blocking API functions

48
00:03:29,910 --> 00:03:34,540
when we call any of them will be moved to the block states, right.

49
00:03:35,400 --> 00:03:39,310
OK, so this order is for this lesson on TASC states.

50
00:03:39,570 --> 00:03:40,590
I'll see in the next lesson.
