Now we are going to talk about scheduling a scheduler is the most important piece of code that an Arktos
or any operating system actually could out.
Now, who decides which desk should be running?
The scheduler is the one to do that.
And it is an algorithm that decides at any given moment which desk has enough priority to be executing,
though a scheduler can store it, can pose or can suspend or even delete the desk at any time.
Now, for a single core processor, we know that and we've talked about that.
Only one task can be running at a time, but we will be flipping in between tasks in order to have a
semi parallel running scheme.
Now, those all the states for our desks, let us enlarge them.
A task could be ready, meaning that it's ready to be picked by a scheduler so that it can go into running,
though mainly it's either in real estate or in running state in red state, meaning it's just waiting
for the scheduler to pick it.
Once the scheduler picks it, it's going to be running and executing.
Imagine it would be a media player or it could be a Web browser.
It could be anything.
Now, let's say that for some reason you are not using your media player exposed.
It could be in the suspended state.
Now, let's say that your desk was running, but then it was waiting for something.
We are going to learn about resources allocation.
So I'm going to give you a very simple example.
Let's say that two tasks are trying to print to the cereal print.
Remember the cereal print in the Adreno?
We only have one resource for cereal printing.
If multiple tasks want to access it, they should be arranged so that one at a time can access this
resource.
Otherwise, we will have a conflict.
Let's say we have desk one and desk to desk one is waiting to be writing to the LCD or to the serial
printer and desk two is already writing.
No desk one is waiting its turn, so while its waiting, it could be in the blocked state.
So when a desk is waiting, let's say, for a resource to be available, then it is in the blocked state.
If it's running and doing its job, it's in running state.
The schedule could at any time suspend the task and either resume it later and set it ready or keep
it in the suspension for any given reason, the schedule or algorithm can actually specify that or you
as a user, you could actually specify when a task should be suspended.
Now, those are the definitions that we I have just talked about, and you can just read them slowly
and if you have any question, you can just ask me in the Q and A.