Your computer runs lots of programs at once โ but the CPU can only do one thing at a time. How does it decide what goes first?
A process is just a program that's running โ Spotify, Chrome, a game. Your CPU can only work on one process at a time, switching between them so fast it looks like they're all running simultaneously.
A scheduling algorithm is the rule the operating system uses to decide which process gets the CPU next.
Pick a real-world situation to see scheduling in action, or build your own below.
Spotify, Instagram, WhatsApp and a game all competing for your phone's CPU
5 students send print jobs โ some big, some small. Who prints first?
Fortnite needs lots of CPU, while Discord and Chrome run in the background
Create your own processes and experiment
| Process | Arrival Time | Burst Time | Priority |
|---|
| Algorithm | How it works | Real-world example | Problem |
|---|---|---|---|
| FCFS | Run processes in arrival order | Queue at a shop | Convoy effect โ slow job blocks everyone |
| SJF | Shortest job runs first | "10 items or fewer" express checkout | Starvation โ long jobs may never run |
| Round Robin | Each process gets a fixed time slice, then goes to the back of the queue | Taking turns on a games console | Context switching overhead |
| Priority | Most important process runs first | A&E triage โ most urgent patient first | Starvation โ low priority may wait forever |