5 tasks / 1 CPU / 4 scheduling policies

5.40avg wait
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

PidTaskArrivalBurstPriority
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
PidTaskATBTCTTATWT
P1Data preprocessing07770
P2Model training21219175
P3Model validation44231915
P4Model inference52252018
P5Report generation95302116
Average across 5 tasks16.8010.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.

AlgorithmAvg waiting timeAvg TATAvg responseSwitches
10.80
16.8010.804
5.40
11.405.404
12.80
18.804.2011
6.80
12.806.804
SJF wins this workload.

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.