SJF and SRTF
Preemption on arrival, step by step.
Module 2
Session 2.5
Lesson 2 of 5
Shortest Job First (SJF) & SRTF CPU Scheduling
An Interactive, Step-by-Step Simulator for Non-Preemptive SJF & Preemptive SRTF
Scheduling Algorithm Mode
Process Configuration
SJF / SRTF Rules
- Optimal Efficiency: Provably yields the absolute lowest average waiting time (WT).
- Non-Preemptive (SJF): Once started, a process runs to completion regardless of new arrivals.
- Preemptive (SRTF): If a new process arrives with a remaining burst shorter than the currently running process, the CPU is preempted immediately.
- Tie-Breaking Rule: Equal remaining burst times are broken by Arrival Time (\(AT\)) first, then PID rank (\(P_1 > P_2\)).
Simulation Controls
Initializing simulator... Click "Step Forward" or "Play" to start.
Interactive Gantt Chart
Hover or click on any Gantt block or process table row to view step-by-step metric formulas.
Process Execution Metrics
| PID | Arrival (\(AT\)) | Burst (\(BT\)) | Completion (\(CT\)) | Turnaround (TAT = CT − AT) | Waiting (WT = TAT − BT) | Response (RT) |
|---|