Process Scheduling in OS: Long, Medium, Short Term Scheduler
โก Smart Summary
Process Scheduling is an operating system task that manages processes across ready, waiting, and running states. It allocates CPU time to each process, keeps the CPU busy, and reduces response time using long-term, medium-term, and short-term schedulers.

What is Process Scheduling?
Process Scheduling is an OS task that schedules processes of different states like ready, waiting, and running.
Process scheduling allows the OS to allocate a time interval of CPU execution for each process. Another important reason for using a process scheduling system is that it keeps the CPU busy all the time. This allows you to get the minimum response time for programs.
Process Scheduling Queues
Process Scheduling Queues help you to maintain a distinct queue for each and every process state and PCB. All the processes of the same execution state are placed in the same queue. Therefore, whenever the state of a process is modified, its PCB needs to be unlinked from its existing queue and moved back to the new state queue.
Three types of operating system queues are:
- Job queue โ It helps you to store all the processes in the system.
- Ready queue โ This type of queue helps you to set every process residing in the main memory, which is ready and waiting to execute.
- Device queues โ It is a process that is blocked because of the absence of an I/O device.

In the above-given diagram:
- A rectangle represents a queue.
- A circle denotes the resource.
- An arrow indicates the flow of the process.
- Every new process is first put in the Ready queue. It waits in the ready queue until it is finally processed for execution. Here, the new process is put in the ready queue and waits until it is selected for execution, or it is dispatched.
- One of the processes is allocated the CPU and it is executing.
- The process should issue an I/O request.
- Then, it should be placed in the I/O queue.
- The process should create a new subprocess.
- The process should be waiting for its termination.
- It should be removed forcefully from the CPU, as a result of an interrupt. Once the interrupt is completed, it should be sent back to the ready queue.
Two State Process Model
Two-state process models are:
- Running State
- Not Running State
Running
In the Operating system, whenever a new process is built, it is entered into the system, which should be running.
Not Running
The processes that are not running are kept in a queue, which is waiting for their turn to execute. Each entry in the queue is a point to a specific process.
Scheduling Objectives
Here are the important objectives of Process scheduling:
- Maximize the number of interactive users within acceptable response times.
- Achieve a balance between response and utilization.
- Avoid indefinite postponement and enforce priorities.
- It also should give reference to the processes holding the key resources.
Type of Process Schedulers
A scheduler is a type of system software that allows you to handle process scheduling.
There are mainly three types of Process Schedulers:
- Long Term Scheduler
- Short Term Scheduler
- Medium Term Scheduler
Long Term Scheduler
The Long term scheduler is also known as a job scheduler. This scheduler regulates the program and selects processes from the queue and loads them into memory for execution. It also regulates the degree of multi-programming.
However, the main goal of this type of scheduler is to offer a balanced mix of jobs, like Processor and I/O jobs, that allows managing multiprogramming.
Medium Term Scheduler
Medium-term scheduling is an important part of swapping. It enables you to handle the swapped-out processes. In this scheduler, a running process can become suspended, which makes an I/O request.
A running process can become suspended if it makes an I/O request. A suspended process cannot make any progress towards completion. In order to remove the process from memory and make space for other processes, the suspended process should be moved to secondary storage.
Short Term Scheduler
Short term scheduling is also known as the CPU scheduler. The main goal of this scheduler is to boost the system performance according to set criteria. This helps you to select from a group of processes that are ready to execute and allocates the CPU to one of them. The dispatcher gives control of the CPU to the process selected by the short term scheduler.
Difference between Schedulers
Long-Term Vs. Short Term Vs. Medium-Term:
| Long-Term | Short-Term | Medium-Term |
|---|---|---|
| Long term is also known as a job scheduler. | Short term is also known as CPU scheduler. | Medium-term is also called swapping scheduler. |
| It is either absent or minimal in a time-sharing system. | It is insignificant in the time-sharing order. | This scheduler is an element of Time-sharing systems. |
| Speed is less compared to the short term scheduler. | Speed is the fastest compared to the short-term and medium-term scheduler. | It offers medium speed. |
| Allows you to select processes from the load and pool back into the memory. | It only selects processes that are in a ready state of execution. | It helps you to send process back to memory. |
| Offers full control. | Offers less control. | Reduces the level of multiprogramming. |
What is Context switch?
It is a method to store/restore the state of a CPU in the PCB, so that process execution can be resumed from the same point at a later time. The context switching method is important for a multitasking OS.
