← Operating Systems Interactive execution lab

CPU Scheduling Arena

Replay every clock tick and compare five schedulers fairly on the same workload.

Deterministic simulation · ⚡ 0 XP
1 · Build a workload

Process editor

One process per line. A lower priority number means higher priority.

1–8 processes · integer times · quantum 1–20

2 · Choose the policy

Scheduling algorithm

Preemptive
Round Robin

Rotate a FIFO ready queue after each process uses one time quantum.

Deterministic tie-break

FIFO queue; simultaneous arrivals keep input order, and boundary arrivals enqueue before the expired process.

3 · Replay execution

Gantt timeline

Clockt=0
Advance the trace to build the schedule tick by tick.
Ready queue
1P1
Running CPU idle
Completed
None yet
P1ready
Remaining5 / 5
Arrival 0Priority 2
P2not-arrived
Remaining3 / 3
Arrival 1Priority 1
P3not-arrived
Remaining1 / 1
Arrival 2Priority 0
P4not-arrived
Remaining2 / 2
Arrival 4Priority 3
1 / 13
4 · Inspect the outcome

Per-process metrics

11 makespan 6 switches 100% CPU use
ProcessArrivalBurstPriorityFirst runCompletionWaitingTurnaroundResponse
P10520116110
P2131210691
P321045232
P442379353
Average4.2571.50
Same workload · all policies

Side-by-side comparison

Round Robin uses q=2. Lower averages are highlighted—not universally “better.”

Non-preemptive

FCFS

Avg waiting
3.75
Avg turnaround
6.50
Avg response
3.75
Context switches
3
Makespan
11
Non-preemptive

SJF

Avg waiting
3
Avg turnaround
5.75
Avg response
3
Context switches
3
Makespan
11
Preemptive

SRTF

Avg waiting
2
Avg turnaround
4.75
Avg response
0.25
Context switches
5
Makespan
11
Non-preemptive

Priority

Avg waiting
3.25
Avg turnaround
6
Avg response
3.25
Context switches
3
Makespan
11
Preemptive

Round Robin

Viewing
Avg waiting
4.25
Avg turnaround
7
Avg response
1.50
Context switches
6
Makespan
11