Objective
Schedule a batch of processes under FCFS, SJF, priority and round-robin and compare waiting times, turnaround times and response times.
The idea
The CPU can only run one process at a time, so someone must pick the next. Try each policy on the same workload and see who waits and who starves.
Try this
- 1Run the same processes under FCFS and SJF and compare wait times.
- 2Give a long job a high priority and see the short ones starve.
- 3Tune the time quantum in round-robin and watch turnaround change.
- 4Add arrival times and see how 'shortest job first' stops being optimal.
Watch for
- FCFS is simple but short jobs queue behind long ones.
- SJF minimises average wait but can starve long jobs.
- Round-robin guarantees progress but context switches cost time.
- No policy is best for everything - it depends on the workload.