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.

What is the 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.

The 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.