CPU Scheduling Simulation
Watch how processes enter the ready queue, get dispatched onto the CPU core, and finish under FCFS, SJF, SRTF, and Round Robin.
Interactive simulation
- CPU
- IDLE
- Ready queue
- 0
- Completed
- 0 / 6
- Avg WT
- 0.0
- Avg TAT
- 0.0
- Speed
- 1x
Legend
- Waiting to arrive
- In Ready Queue
- Running on CPU
- Completed
- Selected (click Terminate)
- Terminated
Event log
How to use this simulation
- Pick FCFS, SJF, SRTF, or Round Robin (and quantum
q), then press Dispatch or Resume to watch processes move into the Ready Queue and onto the CPU Core. - Click any active process token to select it, then press Terminate to stop that process.
- Use Step to advance one event, Slower (down to 0.25x) and Faster (up to 4x) for animation speed, and Reset to restart.
1. Ready Queue to CPU Core
Processes enter the Ready Queue as their arrival time is reached. The scheduler picks the next process according to the active policy—arrival order in FCFS, shortest burst in SJF, shortest remaining time in SRTF, or rotating slices in Round Robin.
2. Preemption & Time Quantum
In SRTF, a newly arrived job with less remaining time preempts the current process. In Round Robin, a process runs until it finishes or uses up its quantum q, then returns to the ready queue.
3. Waiting Time (WT) & Turnaround Time (TAT)
Each process token displays its remaining burst RT and, once finished, its waiting time WT and turnaround time TAT.
Scheduling algorithm comparison
| Algorithm | Preemptive? | Order | Strength | Trade-off |
|---|---|---|---|---|
| FCFS | No | Arrival order | Simple & predictable | Convoy effect |
| SJF | No | Shortest burst | Low average wait | Starvation of long jobs |
| SRTF | Yes | Shortest remaining | Minimal average wait | Frequent preemption |
| Round Robin | Yes | FIFO + quantum q | Fair & responsive | Context switch overhead |
Key takeaways
TAT = Completion - ArrivalandWT = TAT - Burst.- Watch the animated CPU Core and Gantt Timeline to see how preemption and quantum slices change execution order.
Related topics
Go-Back-N
Sliding window ARQ with cumulative ACKs.
Selective Repeat
Sliding window ARQ with individual ACKs and buffering.
Deadlock & Banker's Algorithm
Resource allocation and safe-state checks.
Coming soonPaging & Virtual Memory
Address translation and page replacement.
Coming soon