01 / CPU SCHEDULERWho gets the CPU?
Six scheduling policies on one workload. Scrub the timeline to see every dispatch, preemption and context switch, and why it happened.
Workload
| Name | Arr | Bursts | Pri | ||
|---|---|---|---|---|---|
Bursts alternate CPU · I/O · CPU
Algorithm
Each process gets a fixed time slice, then goes to the back of the queue. Good response time; the quantum is the whole game.
Compare
Run the same workload through up to two more algorithms. All timelines share one clock.
Timeline
runningreadyI/Oswitch
Queues · RR (q=2)
CPUP15 left
Ready
empty
I/O
—
Done
—
Metrics
Avg waiting
8.75
Avg turnaround
15.50
Avg response
1.75
CPU utilization
100%
Throughput
1.82
per 10 ticks
Context switches
11
| Proc | Arr | Done | Turn | Wait | Resp |
|---|---|---|---|---|---|
| P1 | 0 | 20 | 20 | 10 | 0 |
| P2 | 1 | 11 | 10 | 7 | 1 |
| P3 | 2 | 22 | 20 | 12 | 2 |
| P4 | 4 | 16 | 12 | 6 | 4 |
Final values; rows brighten as each process completes.
Explain
P1 arrives. P1 dispatched.
RR (q=2): P1 is at the head of the ready queue.
00/22