CPU Scheduling Algorithms

Explore the fundamental algorithms that power modern operating systems and learn how they optimize CPU utilization for maximum performance.

First Come First Serve (FCFS)

FCFS schedules processes strictly in the order of their arrival in a queue. When a process arrives, it's added to the end of the queue and processed sequentially.

Shortest Job First (SJF)

SJF selects the process with the shortest estimated execution time next. The main objective is to minimize the average waiting time across all processes. It favors shorter tasks for faster completion.

Shortest Remaining Time First (SRTF)

SRTF is a preemptive version of SJF. The CPU selects the process with the shortest remaining time to complete, allowing interruptions for shorter jobs.

Priority Scheduling

Processes are assigned priority levels and the CPU selects the highest priority process first. Can be implemented as preemptive or non-preemptive.

Round Robin (RR)

Each process is assigned a fixed time quantum. Processes are placed in a circular queue and the CPU switches between them after each time slice.

Multilevel Queue (MLQ)

Divides processes into multiple queues based on priority or type. Each queue can have its own scheduling algorithm and processes don't move between queues.