AfterAcademy Tech
•
05 Nov 2019

In the Operating System, CPU schedulers are used to handle the scheduling of various processes that are coming for its execution by the CPU. Schedulers are responsible for transferring a process from one state to the other. Basically, we have three types of schedulers i.e.
In this blog, we will learn about these schedulers and we will see the difference between them. Also, at the end of the blog, we will look where these schedulers are placed in the Process State Diagram. So, let's get started.
Long-Term schedulers are those schedulers whose decision will have a long-term effect on the performance. The duty of the long-term scheduler is to bring the process from the JOB pool to the Ready state for its execution.
Long-Term Scheduler is also called Job Scheduler and is responsible for controlling the Degree of Multiprogramming i.e. the total number of processes that are present in the ready state.
So, the long-term scheduler decides which process is to be created to put into the ready state.
Effect on performance
Short-term schedulers are those schedulers whose decision will have a short-term effect on the performance of the system. The duty of the short-term scheduler is to schedule the process from the ready state to the running state. This is the place where all the scheduling algorithms are used i.e. it can be FCFS or Round-Robin or SJF or any other scheduling algorithm.
Short-Term Scheduler is also known as CPU scheduler and is responsible for selecting one process from the ready state for scheduling it on the running state.
Effect on performance
The following image shows the scheduling of processes using the long-term and short-term schedulers.

Sometimes, you need to send the running process to the ready state or to the wait/block state. For example, in the round-robin process, after a fixed time quantum, the process is again sent to the ready state from the running state. So, these things are done with the help of Medium-Term schedulers.
Medium-term schedulers are those schedulers whose decision will have a mid-term effect on the performance of the system. It is responsible for swapping of a process from the Main Memory to Secondary Memory and vice-versa.
It is helpful in maintaining a perfect balance between the I/O bound and the CPU bound. It reduces the degree of multiprogramming.
The following diagram will give a brief about the working of the medium-term schedulers.

Following is the difference between the long-term, short-term, and medium-term schedulers:

The Process State Diagram is used to display the flow of processes from one state to other. In this portion of the blog, we will see the position of long-term, short-term, and medium-term schedulers in the Process State Diagram. Following is the image of the same:

That's it for this blog. Hope you enjoyed this blog.
Do share this blog with your friends to spread the knowledge. Visit our YouTube channel for more contents.
Keep Learning 🙂
Team AfterAcademy!
AfterAcademy Tech
In this blog, we will learn about various process scheduling algorithms used in Operating System. We will learn about FCFS, SJF, SRTF, Round-Robin, Priority-based, Highest Response Ratio Next, Multilevel Queue, and Multilevel Feedback Queue scheduling.

AfterAcademy Tech
In this blog, we will learn about Dispatchers in Operating System and we will also learn the difference between a Scheduler and a Dispatcher.

AfterAcademy Tech
In this blog, we will learn about Preemptive and Non-Preemptive Scheduling. We will also look at the difference between these two.

AfterAcademy Tech
In this blog, we will learn what is an entity, entity type and entity set and how these terms are related. We will learn the difference between these terms as these terms are often used interchangeably. We will take various examples to understand this.
