Scheduler, Short-term Scheduler, Long-term Scheduler, Medium term Scheduler – Operating Systems OS

Scheduler, Short-term Scheduler, Long-term Scheduler, Medium term Scheduler – Operating Systems OS

In this tutorial, we try to answer the following questions;

  1. What is scheduler?
  2. Long-term scheduler
  3. Short-term scheduler
  4. Medium-term scheduler

What is scheduler?

Currently, OS supports multitasking. So users always wish to execute many processes together on the CPU. To solve this problem Scheduler provides the service to schedule the processes to executes on the CPU.  The schedule is the part of the OS that helps the OS to schedule the processes. 

The scheduler selects the process form the ready queue and allocates the CPU to that process.

Ready queue is maintained by any of the scheduling algorithms like First come first served, shortest job first or priority scheduling algorithm etc.

Types of schedulers

There are many types of a scheduling algorithm in OS. Three most fundamental types of schedules are followings;

  1. Long-term scheduler
  2. Short-term scheduler
  3. Medium-term scheduler

Long-term scheduler

The long-term scheduler selects a job from the job queue and allows a process to load it into the main memory. It means that this is the schedule that handles that how much maximum jobs/processes can be loaded on the main memory.

Short term scheduler

Short term scheduler selects a process from ready queue and allocates CPU to that process. After this state of a process is change from ready state to running state.

Medium-term scheduler

A medium-term scheduler is responsible for swapping. Some jobs are swapped from hard disk to the main memory and some jobs can be swapped out from the main memory to the hard disk.