1
00:00:00,790 --> 00:00:01,940
Hello, welcome back.

2
00:00:02,380 --> 00:00:08,920
In this lesson, we going to experiment with different configurations of our shetler have created a

3
00:00:08,920 --> 00:00:12,940
new project here called 32 Deshler Preemption Only.

4
00:00:13,240 --> 00:00:20,110
And what we're going to do over here is disable the time slicing option in our scheduler such that our

5
00:00:20,110 --> 00:00:25,480
scheduler has just preemption and we want to observe the effect that would have on our program.

6
00:00:25,900 --> 00:00:27,250
So this is the project.

7
00:00:27,410 --> 00:00:28,080
It's empty.

8
00:00:28,090 --> 00:00:29,800
There is no school here.

9
00:00:31,180 --> 00:00:38,410
We are going to go to our free ARTUS configurator, followed by opening the include fuda here and if

10
00:00:38,410 --> 00:00:42,190
we are to US configurator and then we'll check what we currently have.

11
00:00:43,800 --> 00:00:47,790
Currently, our schedule has configures preemptions set to one.

12
00:00:48,760 --> 00:00:55,750
And then config use less lead time slicing what a time slices here.

13
00:00:56,910 --> 00:01:00,180
We can simply surge control F and then.

14
00:01:01,080 --> 00:01:03,600
We can say slice, we can search the words slice.

15
00:01:06,300 --> 00:01:09,170
OK, time slicing, it's not written here.

16
00:01:10,620 --> 00:01:11,220
Let's see.

17
00:01:13,870 --> 00:01:17,560
Perhaps slicing, yes, lyson is the word rather than slice.

18
00:01:20,960 --> 00:01:28,870
OK, slicing the snow here, so we have config use preemption this year, if we want to have our shetler

19
00:01:28,970 --> 00:01:33,320
with time slicing, we can define time slicing here, OK?

20
00:01:35,540 --> 00:01:41,510
So what I'm going to do is I'm going to define configures time slicing and then I'll set it to zero

21
00:01:41,660 --> 00:01:42,810
and then we see something.

22
00:01:43,970 --> 00:01:47,270
OK, so over here, close to config use preemption.

23
00:01:47,450 --> 00:01:50,180
I'm going to have a new define over here.

24
00:01:52,260 --> 00:01:56,570
I see defined config use time slicing, and this is zero.

25
00:01:58,510 --> 00:02:08,320
OK, right, so this is our main road to see far less, I did a number of a number of tasks and run

26
00:02:08,320 --> 00:02:09,030
the experiment.

27
00:02:09,340 --> 00:02:11,830
So we're going to have less, say, four tasks.

28
00:02:12,820 --> 00:02:17,440
Each task would have its own profiler, the task profile that we created.

29
00:02:17,830 --> 00:02:25,090
So I'm going to come over here and define the profile this or come over here and then the profiler.

30
00:02:25,090 --> 00:02:28,390
We're simply using TYPEDEF to create a new name for this.

31
00:02:28,570 --> 00:02:32,800
You intended to underscore T word and we defined an orange task profile.

32
00:02:32,800 --> 00:02:34,930
I read the task profile are green and blue.

33
00:02:35,590 --> 00:02:39,730
OK, so once this is done, we going to create four tasks.

34
00:02:40,480 --> 00:02:45,610
We're going to have one for orange alert controller, red ality controller blue and the controller and

35
00:02:45,610 --> 00:02:46,630
green the controller.

36
00:02:46,630 --> 00:02:50,950
We're going to have one task for each controller such that we end up with this.

37
00:02:51,250 --> 00:02:52,150
We've done this before.

38
00:02:52,180 --> 00:02:55,280
This is the same as our first task creation project.

39
00:02:55,840 --> 00:02:56,260
So.

40
00:02:57,890 --> 00:02:58,730
What do we have here?

41
00:02:58,760 --> 00:02:59,420
We have.

42
00:03:00,530 --> 00:03:06,650
Task create the name of this task, task function will be orange, the controller, it has a priority

43
00:03:06,650 --> 00:03:07,120
of one.

44
00:03:07,640 --> 00:03:08,600
We have this one.

45
00:03:08,630 --> 00:03:11,650
The name of this task function will be the controller.

46
00:03:11,870 --> 00:03:13,640
It's a priority of two.

47
00:03:14,390 --> 00:03:15,560
We have this other one.

48
00:03:15,710 --> 00:03:17,400
The name of it will be Red Alert.

49
00:03:17,420 --> 00:03:22,380
The controller is got a priority of two as well, and then green the controller.

50
00:03:22,670 --> 00:03:24,800
So in summary, we have four tasks.

51
00:03:25,010 --> 00:03:29,720
Two of them have a priority of two and two of them have a priority of one.

52
00:03:29,960 --> 00:03:32,980
So we have two of them with a higher priority than the others.

53
00:03:33,620 --> 00:03:42,860
So what are we going to do basically is just place each task profiler and each of the task functions.

54
00:03:44,120 --> 00:03:49,160
So I come down here and then I'll create a task function for blue controller task.

55
00:03:49,550 --> 00:03:56,300
All I'm doing is incrementing the blue task profile in incrementing the global variable.

56
00:03:56,780 --> 00:04:01,550
I'm going to do exactly the same thing for the other tasks.

57
00:04:02,390 --> 00:04:07,580
I'll do it for Red and then I'll do it for orange.

58
00:04:10,140 --> 00:04:13,980
Over here, and then I'll do it for green.

59
00:04:15,680 --> 00:04:21,050
OK, so each task is performing a simple task, which is increment a global variable.

60
00:04:21,440 --> 00:04:28,820
OK, and we know that we have blue and red with the highest priority.

61
00:04:29,430 --> 00:04:34,660
OK, so now what we have to do is take the task functions and declare them at the top.

62
00:04:35,480 --> 00:04:39,350
So I'll declare the task functions at the top over here.

63
00:04:40,070 --> 00:04:43,040
So we have our blue, red, orange, green.

64
00:04:44,480 --> 00:04:48,970
OK, so back to our three Arktos config dots each file.

65
00:04:49,010 --> 00:04:53,510
Our scheduler says we are using preemption by no time slicing.

66
00:04:53,850 --> 00:05:00,590
OK, what we would expect without understanding how the scheduler works, what we would expect is that

67
00:05:01,190 --> 00:05:09,170
OK, since we have two tasks here with the same priority, then these two tasks should be the only ones

68
00:05:09,170 --> 00:05:09,590
running.

69
00:05:10,940 --> 00:05:15,890
Unless they go to sleep or they get blocked before the lower priority tasks should run.

70
00:05:16,120 --> 00:05:16,610
Correct.

71
00:05:17,640 --> 00:05:18,810
OK, I heard you.

72
00:05:19,350 --> 00:05:21,440
So let's see what we get with this.

73
00:05:22,440 --> 00:05:23,730
I'll click over here to build.

74
00:05:28,400 --> 00:05:29,150
It's bugden.

75
00:05:30,920 --> 00:05:35,990
OK, so we've got our you at we can delete the Ewart's.

76
00:05:37,680 --> 00:05:38,900
Oh, goodness.

77
00:05:40,410 --> 00:05:48,440
You out in the system clock, I cleaned the prototypes, so we simply have to bring them over here.

78
00:05:51,530 --> 00:05:57,710
As this clock as well as Jhpiego system clocked in A to function Prototyp.

79
00:05:59,040 --> 00:06:03,270
No, I just copied System Clock, so I copied the one for you at.

80
00:06:09,860 --> 00:06:11,870
And then I'll copy the one for you.

81
00:06:18,550 --> 00:06:25,720
And in fact, what I'm going to do is we don't need we don't need a new article because of the letter.

82
00:06:25,720 --> 00:06:30,330
The other instance I would need to put it about, because we don't need you out for this experiment.

83
00:06:30,700 --> 00:06:33,570
I'm simply going to delete you at function.

84
00:06:34,260 --> 00:06:38,170
OK, so if that is deleted, then we need not call you to over here.

85
00:06:38,770 --> 00:06:41,020
We need not call you at as simple as that.

86
00:06:41,080 --> 00:06:41,470
OK.

87
00:06:42,740 --> 00:06:47,810
Dispute over here, we're going to run the experiment, just observing the debug for you, I'll click

88
00:06:47,810 --> 00:06:48,410
here to build.

89
00:06:52,390 --> 00:06:53,980
OK, it's built successfully.

90
00:06:54,920 --> 00:07:02,710
All right, click over here, I'll go to debuggers ASTM 30 to select the current project.

91
00:07:04,830 --> 00:07:06,420
I've seen OK over here.

92
00:07:11,660 --> 00:07:13,700
It's opening click to switch.

93
00:07:17,890 --> 00:07:25,300
And I'll come to our live expressions window, I'll clear everything over here, Live Expression's.

94
00:07:26,820 --> 00:07:33,950
I see remove oh, and I'm going to add all of our task, this stuff with orange.

95
00:07:36,730 --> 00:07:38,770
I'll start with and then I'll go on to read.

96
00:07:41,600 --> 00:07:42,530
And then green.

97
00:07:47,760 --> 00:07:48,540
And then blue.

98
00:07:51,990 --> 00:07:54,600
OK, let's run and see a click here to run.

99
00:07:56,030 --> 00:08:03,250
OK, so perhaps we've not started our search to see, OK, the scheduler is not started, so let's start

100
00:08:03,260 --> 00:08:06,580
a scheduler and see what we get with this configuration.

101
00:08:07,070 --> 00:08:11,240
So we call X task scheduler over here, click to build.

102
00:08:15,780 --> 00:08:18,570
It's built successfully, like to go to the bug for you here.

103
00:08:23,810 --> 00:08:24,730
Like switch.

104
00:08:25,920 --> 00:08:26,580
Over here.

105
00:08:28,420 --> 00:08:29,680
So a quick run.

106
00:08:31,080 --> 00:08:33,600
And we have just a blue task running.

107
00:08:35,480 --> 00:08:41,420
OK, so let's see, we have blue and red having the same.

108
00:08:42,470 --> 00:08:49,700
Priority, but because we said time slicing is zero, because we've disabled homeslice in the time is

109
00:08:49,700 --> 00:08:51,950
not shared between the two high priority task.

110
00:08:53,310 --> 00:09:00,120
Only this task is running on less blue, goes to sleep or less blue is blocked before red will have

111
00:09:00,120 --> 00:09:01,000
time to run.

112
00:09:01,830 --> 00:09:06,930
So just to show you what I mean, we're going to set time slice into one.

113
00:09:06,930 --> 00:09:11,910
In effect, we're going to enable time slicing and then we'll see what effect that would have.

114
00:09:12,430 --> 00:09:20,250
So I'll come over here to a free config file and then time in here, I'm going to set it to one less

115
00:09:20,270 --> 00:09:20,550
exit.

116
00:09:20,550 --> 00:09:20,910
This.

117
00:09:23,550 --> 00:09:24,660
OK, let's build.

118
00:09:30,550 --> 00:09:31,270
It's viewed in.

119
00:09:36,070 --> 00:09:38,200
And then we click here to go to The View.

120
00:09:44,380 --> 00:09:44,950
Switch.

121
00:09:48,990 --> 00:09:49,710
It's Lodin.

122
00:09:51,760 --> 00:09:52,870
We click here to run.

123
00:09:53,970 --> 00:09:58,830
You know, as you can see, we have red and blue run, and of course, these are the two tasks with

124
00:09:58,830 --> 00:10:02,840
a higher priority compared to the rest, because we've enabled time slicing.

125
00:10:03,060 --> 00:10:08,010
Now the time is shared between the two high priority tasks in the system.

126
00:10:08,430 --> 00:10:15,120
OK, so the question becomes, how come when we disable a tiny slice in blue was the one running, why

127
00:10:15,120 --> 00:10:20,460
wasn't red selected since they have the same priority over here as a first come, first serve because

128
00:10:20,460 --> 00:10:21,720
Blue was created first?

129
00:10:22,140 --> 00:10:27,300
That is why Blue was the only one running when time slicing was disabled.

130
00:10:28,170 --> 00:10:30,210
Because blue was created before red.

131
00:10:30,570 --> 00:10:37,620
OK, so this is the effect that time slicing offers to us and of course we know why the other low priority

132
00:10:37,620 --> 00:10:38,780
tasks aren't running.

133
00:10:39,600 --> 00:10:44,280
These ones have to go to sleep before any time will be offered to.

134
00:10:44,280 --> 00:10:46,360
These was the lower priority tasks.

135
00:10:47,160 --> 00:10:49,020
So that's all there is for this lesson.

136
00:10:49,050 --> 00:10:49,930
I'll see you later.

137
00:10:49,980 --> 00:10:50,750
Have a nice day.
