Long Term Short Term and Middle Term Schedulers

For Complete YouTube Video: Click Here

This class tries to understand Long Term Short Term and Middle Term Schedulers.

We have discussed the concept of a process state diagram in our previous classes.

Long Term Short Term and Middle Term Schedulers

To understand this concept, we will consider the process state diagram below.

The Long Term Short Term and Middle Term Schedulers are used to switch the processes from one state to another state.

Long Term Scheduler

The long-term scheduler brings the process from the job queue (or secondary memory) into the ready queue (or main memory).

The long-term scheduler is in between the New State and Ready State.

The job of the long-term scheduler is to bring the process into the job pool into the ready state.

This scheduler is called a long-term scheduler because the decision made by this scheduler will have a long-term effect on the overall system’s performance.

The long-term scheduler has to choose a mix of I/O-bound and CPU-bound processes. If the long-term scheduler chooses only I/O-bound processes, then all processes will be in the wait state, and the CPU will be ideal.

The long-term scheduler will choose a mix of I/O-bound and CPU-bound processes to avoid that.

Short-Term Scheduler

The job of the short-term scheduler is to switch the process from the ready state to the running state.

Middle-Term Scheduler

The job of the middle-term scheduler is to handle the swapped-out processes.

For example, if a process in the wait state is waiting for the longest period for its I/O operation to be done, and another process in the running state wants to come into the wait state, there is no room for that process.

The middle-term scheduler will switch the process from the wait state to the suspend-wait state.

These processes are called swapped-out processes.