Process Scheduling is a key component of modern operating systems. It refers to the mechanism by which the operating system selects which process should be executed by the CPU at any given time. Process Scheduling includes CPU Scheduling, Disk Scheduling, and other resource allocation techniques.
CPU Scheduling is the process of determining which process should be executed next by the CPU. The goal of CPU scheduling is to maximize the utilization of the CPU while minimizing the response time and turnaround time of processes. The CPU Scheduler selects a process from the ready queue and allocates CPU time to it. There are different scheduling algorithms such as First Come First Serve (FCFS), Shortest Job First (SJF), Round Robin (RR), Priority Scheduling, etc.
Disk Scheduling is the process of determining the order in which disk I/O requests should be serviced. Disk Scheduling algorithms attempt to minimize the average response time and maximize the throughput of the disk subsystem. Some popular disk scheduling algorithms are FCFS, SSTF, SCAN, LOOK, C-SCAN, etc.
The Process Scheduling can be further divided into:
- Short-term scheduling
- Medium-term scheduling
- Long-term scheduling
1. Short-term Scheduling: Also known as CPU Scheduling, it determines which process in the ready queue will execute next and how much CPU time it will be allocated. The objective of short-term scheduling is to provide fast response time and high CPU utilization. Short-term Scheduler is invoked frequently, typically every few milliseconds.
2. Medium-term Scheduling: The objective of medium-term scheduling is to manage the amount of memory needed to execute a process. Medium-term scheduling removes processes from memory and swaps them to the disk, freeing up memory for other processes. Medium-term Scheduler is invoked less frequently than the Short-term Scheduler, typically every few seconds or minutes.
3. Long-term Scheduling: Also known as Job Scheduling, it determines which new process should be admitted to the system. The objective of long-term scheduling is to ensure that the system is not overloaded and that there is enough memory and other resources to execute new processes. Long-term Scheduler is invoked less frequently than the Medium-term Scheduler, typically every few minutes or hours.