OSEasyScheduling
FCFS vs SJF Scheduling â Compare with Example
đ Problem
Compare First-Come-First-Serve (FCFS) and Shortest-Job-First (SJF) CPU scheduling using an example with 3 processes of burst times 6, 2, and 8.
đ§ Approach
In FCFS, processes run in arrival order: 6, then 2, then 8 â the 2-unit process waits 6 units even though it's short, hurting average waiting time. In SJF, the shortest job runs first: 2, then 6, then 8 â this minimizes the average waiting time overall, but requires knowing burst times in advance (often estimated, not guaranteed).