Scheduling Algorithm
To understand this topic in a better way I must recommend you go through once from our last lecture which was about Process Scheduling in Operating System so you may better understand the concept.
The processes wait into the different queues to get the process i.e. Job Queue, Ready Queue and Wait Queue.
This is the responsibility of algorithm to get to check which process should be assigned to processor.
You might be thinking there is nothing like responsibility here just let the process use the process number wise that is why they are already in the queue.
NO! NO! A BIG NO!
Suppose there is a queue of vehicles in the traffic jam and you have authority or say a kind of power by which you can make any vehicle to go first or last. Why wouldn’t you allow an ambulance to go first from that jam by using your powers or say authority.
The same case happens in the process queue some process come with emergency or say they want to get processor on priority basis (There are different cases for which a process wants to get processor on priority basis.)
This is the job of the scheduler algorithm to check which process should get the processor on priority basis that is why the scheduling algorithms are important.
We know we have three different queues Job Queue, Ready Queue and Wait Queue so we have three kind of scheduling algorithms as well.
· Long Term Scheduler
· Short Term Scheduler
· Medium Term Scheduler
Long Term Scheduler: This is responsible for managing the process in the job queue which is in the secondary memory.
Short Term Scheduler: This is responsible for managing the process in the ready queue which is in the main memory.
Medium Term Scheduler: This is not responsible for managing the process in the waiting queue as your thinking.
Why it is not responsible for waiting queue? Process have different states through which it passes in the whole life one out of theme is waiting state when the process is waiting for the I/O operation. After getting the I/O operating it get backs into the ready state that means eventually it will be managed by the short-term scheduler.
Medium Term scheduler is responsible to keep things in the smooth flow. Smooth by keeping they ways of other process clear.
But who block the ways?
Some time a process resides into the main memory and do nothing other than reserving resources short term scheduler swipe it out of the main memory and make space for other process. In some cases a low priority process use more memory in the main memory so to make space for priority basis process this algorithm swipe out that low priority process.
No comments:
Post a Comment