Short-term vs medium-term vs long-term scheduling

Process Scheduling handles the selection of a process for the processor on the basis of a scheduling algorithm and also the removal of a process from the processor. It is an important part of multiprogramming in operating systems.

Process scheduling involves three levels: short-term scheduling, medium-term scheduling, and long-term scheduling. Each operates at different time intervals and serves distinct purposes in the overall system performance.

Long-Term Scheduling

Long-term scheduling involves selecting processes from the storage pool in secondary memory and loading them into the ready queue in main memory for execution. This is handled by the long-term scheduler or job scheduler.

The long-term scheduler controls the degree of multiprogramming ? the number of processes currently in memory. It must select a careful mixture of I/O-bound and CPU-bound processes to yield optimum system throughput. If it selects too many CPU-bound processes, then I/O devices remain idle. If it selects too many I/O-bound processes, then the processor has nothing to do.

Long-Term and Short-Term Scheduling Job Pool (Secondary Memory) P1, P2, P3 Long-term Ready Queue Short-term CPU Terminated

Short-Term Scheduling

Short-term scheduling involves selecting one process from the ready queue and scheduling it for execution. This is done by the short-term scheduler or CPU scheduler. A scheduling algorithm (FCFS, SJF, Round Robin, etc.) determines which process executes next.

The short-term scheduler executes much more frequently than the long-term scheduler, as a process may execute for only a few milliseconds. The choices of the short-term scheduler are critical ? selecting a process with a long burst time can cause starvation for other waiting processes.

Medium-Term Scheduling

Medium-term scheduling involves swapping processes between main memory and secondary storage. The medium-term scheduler can suspend a process by moving it out of memory and later resume it from the point where it stopped executing.

This mechanism helps reduce the degree of multiprogramming when memory becomes overloaded. Swapping also improves the mix of I/O-bound and CPU-bound processes in memory, optimizing overall system performance.

Medium-Term Scheduling (Swapping) Ready Queue CPU Waiting Queue Suspended Queue (Secondary Storage) Swap Out Swap In

Comparison

Scheduler Type Frequency Primary Function Time Scale
Long-term Minutes to hours Control degree of multiprogramming Job admission
Short-term Milliseconds Select next process to execute CPU allocation
Medium-term Seconds to minutes Manage memory through swapping Process suspension

Conclusion

The three levels of process scheduling work together to optimize system performance. Long-term scheduling controls multiprogramming levels, short-term scheduling manages CPU allocation, and medium-term scheduling handles memory management through swapping. This multilevel approach ensures efficient resource utilization and system responsiveness.

Updated on: 2026-03-17T09:01:38+05:30

8K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements