Operating System Notes – Process Scheduling
Process scheduling is one of the fundamental responsibilities of an operating system. It
determines the order in which processes are executed by the CPU, helping maximize
efficiency, responsiveness, and fairness.
🔁 What is Process Scheduling?
When multiple processes are in the ready queue, waiting to be executed, the CPU
scheduler selects one process from the queue to execute. The main goal is to utilize CPU
time effectively and improve system performance.
🧠 Common Scheduling Algorithms:
1. First-Come, First-Served (FCFS)
o Processes are executed in the order they arrive.
o Simple to implement but can cause long waiting times for short processes
following long ones (convoy effect).
2. Shortest Job First (SJF)
o Executes the process with the shortest burst (execution) time first.
o Can be preemptive or non-preemptive.
o Provides minimum average waiting time but requires prior knowledge of
burst time.
3. Round Robin (RR)
o Each process gets a fixed time slice (quantum).
o After the time slice expires, the process is sent back to the ready queue.
o Ideal for time-sharing systems.
o A small quantum leads to better responsiveness but higher context
switching overhead.
4. Priority Scheduling
o Each process is assigned a priority, and the highest priority process is
executed first.
o Can be preemptive or non-preemptive.
o May suffer from starvation—low-priority processes may never get CPU
time.
5. Multilevel Queue Scheduling
o Processes are grouped into different queues based on type (e.g., system,
interactive, batch).
o Each queue can have its own scheduling algorithm.
o Priorities are set between queues.
⏱ Key Performance Metrics
Turnaround Time (TAT) = Completion Time - Arrival Time
Waiting Time (WT) = Turnaround Time - Burst Time
Response Time = First response - Arrival Time
Throughput = No. of processes completed per unit time
CPU Utilization = % of time CPU is working (should be high)
✅ Conclusion
Choosing the right scheduling algorithm depends on the system’s goals—whether it’s
minimizing waiting time, ensuring fairness, or maximizing CPU usage. Understanding
scheduling is essential for optimizing modern operating systems.