Hello, welcome back.
In this lesson, we going to see how to delete a task or in other words, kill a task, right?
I'm going to make a copy of a.
Well, let's see our resume talk project, I'm going to make a copy of this number nine.
Controversy to copy and paste this over here.
I call this number 12.
Children, a task.
And then copy over here.
Right.
So by default, the function for doing things like deleting a task are not enabled by the kernel, so
we need to go to the configuration files to enable those features.
OK, so to go to the configuration file where we would have to do is going to click on Simms's.
I'm going to click on Simms's dot.
One way to do it is to find the free config, each file, and we can do that by going to see him systems
each and then go to free that each and then from free artists each go to free Archos conflict attatched.
Another way is to click free actors to see, followed by here, which is a source for the open free
artist to see.
And in here we find free art or storage, but we do not find conflict.
Orridge So I double click free artists that HLC open declaration.
When we open declaration of this file and scroll down, we have free Arktos conflict each double click
on this and then open declaration.
And this file here gives the configurations of our current system over here config enable FPU.
It says zero meaning we've not enabled FPU here MPU Memory Protection Unit that also says you were meeting
with my neighborhood.
It's static allocation is enabled, dynamic allocation is enabled.
I hook it's not enabled.
Take hook.
It's not enabled.
And see.
Waddell's.
Use mutex is not a neighborhood, it is a neighborhood, OK?
Anywhere you see, zero means it's not a neighborhood.
We came here to see if I want to lead the task.
It's a neighborhood.
So these are the functions.
And neighborhood sets priorities and neighborhood gets priorities.
And Neighborhood Daily Task is actually a neighborhood here.
Task cleanup resource is disabled and all other functions are enabled.
So we can see that the daily task is a neighborhood.
If we change from one to zero over here, we wouldn't be able to use that particular function.
OK.
OK, so let's see how it works, I'm going to come down here, over here.
This is our previous project.
We built a copy of our.
Let's see, let's make sure we are in our project.
No, I live in.
What was the project, no.
Let's see.
Killing the task.
OK, I'm going to rename this the name.
As Retina's 19 is supposed to be 12.
OK, just bear with me.
OK, so I'm going to open the window, see for.
OK, so this is from our Resume Project Resume TASC project, where we suspended Red Read, suspended
itself and then it was resumed by green.
So what we're going to do is we're going to make red kill itself or red delete itself.
I'm still going to keep this resume monitor.
And then I'm going to change the flag here.
From.
The suspended officer is killed and then I'll simply call this.
I could call this execution monitor rather than resume so that it doesn't get confusing.
OK.
Rather than suspend, I change, suspend, monitor to execution monitor, because we're not suspending
here.
So over here.
Red is green to whenever red execute, we bring to increment execution monitor.
And then we're going to see if execution is greater than 50, we're going to set skewed to true.
And then we're going to set the execution one meter to zero and then going, we will call the X. We're
going to call the V task delete function when we personally means delete this same task.
Thank you.
And what we're going to do is.
I'm going to comment on this block in green, remember green control, I was supposed to resume right
after it suspended Green to comment on this.
A highlight this in comments like this, let's build this and see what we have read is going to execute
execution monitor when it's passed is 50 is screen to delete itself.
I'll click here to build.
It's building.
It's been successfully a click here to get onto the board.
I'll see, OK, over here.
Click here to switch.
OK.
So what is of interest is the counter variables of the three tasks.
The profile as Plutarch profile of red and then green, when I click here to run, they are running,
they're all running together.
Let's see what happens.
It would have been good to monitor execution monitor as well to an execution monitor, to live expressionists
in a way, as soon as they hit 50 red stops moving.
And it doesn't move again, Red has, in effect, killed itself.
OK, so let's see, how is this different from suspension?
Well, we're going to attempt to resume, read and see what happens.
I'm going to come over here on comment this block and see over here if Eskild.
If it's killed, then we're going to start running our resume monitor and after that, after resume
monitors greater than 30, we want to resume read this wonderful read and then we're going to set Eskild
back to force, just like we did.
Four is suspend
so quickly to build.
It's built successfully a click here to get onto the boat.
Click here to switch.
What I'm going to do is I'm going to add Eskild.
Oh, execution Wanita sorry, I'm going to add execution monitor to live expressions, I'll copy this.
I'm going to remove this one here knownas or spend money to.
OK, so now let's run this and see.
As you can see, incrementing, execute and monitor, execution monitors incrementing as well, execution
monitor, as soon as it hits 50 read is going to be killed.
It's hits 15 already frozen now resume monitor, as soon as it hits 30 would attempt to resume, right,
but it hits 30.
Nothing happened.
Read wasn't resumed.
So Red was, in effect, deleted.
This is different from suspending it.
OK, so this all the risk for this lesson?
If you have any questions, leave them in the questions and also area, you know, see you later.
Have.