← Back to the playground
ALGORITHM / 04

The shortest ready job goes next.

Non-preemptive SJF picks the ready process with the smallest CPU burst. Future arrivals cannot influence the current decision.

SINGLE CPU / V1.0

Your workload

3 PROCESSES
Simulation model

PROCESSTICKETSARRIVEBURST
◈ Saved on this device
Ready when you are0 / 64 decisions
TIME ELAPSED0 units
CPU BUSY0 units
DECISIONS0

Execution timeline

ONE BLOCK = ONE DISPATCH
⌁A schedule starts with a decision.Press Run or take it one step at a time.

Expected vs. observed

More rounds tell a clearer story.

Expected Observed

Every ticket is a chance at the next slice. Your observed share will take shape as the simulation runs.

Decision trace 0 dispatches+
Abstract time units · no context-switch overhead

Shortest among the jobs that are ready

SJF considers only arrived, unfinished processes. It selects the shortest burst, breaking ties by arrival time and then input order. The chosen process runs to completion. This is non-preemptive SJF, not shortest remaining time first (SRTF).

Arrival times matter

Consider A: arrival 0, burst 6; B: arrival 1, burst 1; C: arrival 0, burst 3. At time zero, B is not ready. C runs from 0–3, then B from 3–4, then A from 4–10. The scheduler cannot choose B first simply because its burst is the shortest overall.

Know the assumptions

This model knows every burst in advance. Real systems usually need estimates of future CPU work. A stream of short arriving jobs can also delay long jobs; this finite classroom model does not prove a bound on waiting under an endless arrival stream.

Use the calculator to compare your workload with FCFS. A different ordering can change average waiting time even though the total requested CPU work is identical. See a finite-workload example for the metric formulas.

KEEP EXPLORINGUnderstand lottery scheduling ↗Lottery vs. round robin ↗Work through arrival times ↗