Lab · Lecture 6
Scheduling simulator
See how each CPU scheduling algorithm decides who runs next, and check your own Gantt charts against the machine.
- 1
Pick an algorithm at the top. Load a slide example from the preset menu or type your own arrival and burst times.
- 2
Press Play under the Gantt chart. The CPU box, the ready queue and the event log explain every decision tick by tick.
- 3
Switch to Practice. You get a random problem, fill in the table by hand, and the simulator marks each cell.
Try this first: keep the FCFS slide preset, switch the algorithm to SJF, and watch the average waiting time drop from 17 to 3.
Algorithm
First come, first served.
The convoy effect: two short jobs wait behind one long one. Avg WT 17, avg TAT 27.
Processes
3 / 10| ID | Arrival | Burst | Remove |
|---|---|---|---|
| P1 | |||
| P2 | |||
| P3 |
Gantt chart
P1 P2 P3P1
P2
P3
P1P2P3idle
t = 30 / 30
CPU
done
Ready queue (front first)
empty
t=30: P3 completes (CT 30). All processes complete
Metrics
TAT = CT - ATWT = TAT - BTRT = first start - ATutilisation = busy / total
| Process | AT | BT | CT | TAT | WT | RT |
|---|---|---|---|---|---|---|
| P1 | 0 | 24 | 24 | 24 | 0 | 0 |
| P2 | 0 | 3 | 27 | 27 | 24 | 24 |
| P3 | 0 | 3 | 30 | 30 | 27 | 27 |
| Average | 27 | 17 | 17 | |||
Context switches
2
Total time
30
CPU utilisation
100.0%
Throughput
0.10 / unit
Compare algorithms
Same processes, all six policies. RR uses q = 2.| Algorithm | Avg WT | Avg TAT | Avg RT | Switches |
|---|---|---|---|---|
| FCFScurrent | 17 | 27 | 17 | 2 |
| SJF | 3 | 13 | 3 | 2 |
| SRTF | 3 | 13 | 3 | 2 |
| Priority NP | 17 | 27 | 17 | 2 |
| Priority P | 17 | 27 | 17 | 2 |
| RR | 6.33 | 16.33 | 2 | 6 |