5 tasks / 1 CPU / 4 scheduling policies
under SJF
The order you run them in is the performance.
Preprocessing, training, validation, inference and reporting all queue for the same processor. SJF finishes the same work with an average wait of 5.40 where the worst policy needs 12.80 — same tasks, same CPU, different order.
- FCFS
- Whoever arrived first runs first. No preemption, no exceptions.
- SJF
- Shortest ready burst goes next. Optimal on waiting time, brutal on long jobs.
- Round Robin
- Each task gets one quantum, then goes to the back of the queue.
- Priority
- Lowest priority number runs next. Urgency beats arrival order.
The workload
Five tasks an AI server actually runs. Edit any cell — arrival, burst or priority — and every figure on this page recomputes on the spot.
Task table
| Pid | Task | Arrival | Burst | Priority | |
|---|---|---|---|---|---|
| P1 | |||||
| P2 | |||||
| P3 | |||||
| P4 | |||||
| P5 |
Run settings
Algorithm on the chart
Priority 1 is the most urgent. All four schedulers here are non-preemptive except Round Robin, which preempts on every quantum expiry.
FCFS on the CPU
Every block is one uninterrupted stretch of CPU time, drawn to scale. Hatched blocks are an idle processor waiting for the next arrival.
- Avg waiting time
- 10.80
- Avg turnaround
- 16.80
- Avg response
- 10.80
- CPU utilisation
- 100.0 %
- Context switches
- 4
Per-task results
TAT = CT − AT · WT = TAT − BT| Pid | Task | AT | BT | CT | TAT | WT |
|---|---|---|---|---|---|---|
| P1 | Data preprocessing | 0 | 7 | 7 | 7 | 0 |
| P2 | Model training | 2 | 12 | 19 | 17 | 5 |
| P3 | Model validation | 4 | 4 | 23 | 19 | 15 |
| P4 | Model inference | 5 | 2 | 25 | 20 | 18 |
| P5 | Report generation | 9 | 5 | 30 | 21 | 16 |
| Average across 5 tasks | 16.80 | 10.80 | ||||
Four schedulers, same workload
The bar is average waiting time, scaled against the worst performer. Lower is better; the highlighted row wins. Click a name to put it on the chart above.
| Algorithm | Avg waiting time | Avg TAT | Avg response | Switches |
|---|---|---|---|---|
10.80 | 16.80 | 10.80 | 4 | |
5.40 | 11.40 | 5.40 | 4 | |
12.80 | 18.80 | 4.20 | 11 | |
6.80 | 12.80 | 6.80 | 4 |
It holds average waiting time at 5.40 against 12.80 for the worst run — a 58% cut — while turning work around in 11.40 on average and paying 4 context switches.
What the numbers mean
Rankings alone do not explain starvation, the convoy effect, or why a long training job punishes everything queued behind it.
The four runs above are computed in the browser. This step sends only the task table and the measured averages to Gemini, which writes the comparison up as prose — the same argument you would make at the viva, with the figures already substituted in.