GOAT EngineerPreparing your learning space…

System Design · Interactive workshop

The CPU scheduling workbench

Build it. Run it. Follow the bytes.

A scheduler chooses among ready jobs. FIFO keeps the running job until it finishes in this model. Round-robin limits each turn with a quantum, improving response for waiting jobs while adding context-switch cost when the quantum expires.

The canvas runs in your browser and needs JavaScript. You can read the model below and read the accompanying Library lesson without JavaScript.

What this machine models

Model os-scheduler-1 schedules fixed integer-tick jobs on one or two identical cores. FIFO is non-preemptive. Round-robin moves an unfinished job to the ready-queue tail when its 1, 2 or 4 tick quantum expires.

A configured 0, 1 or 2 tick switch cost is charged at quantum preemption, including a renewed turn with no competitor. This simplified dispatcher pauses both cores during overhead and charges no ordinary completion-dispatch cost. Arrivals and queue order are deterministic. Response is first run minus arrival; turnaround is finish minus arrival; waiting counts ready-queue ticks.

This is not the Linux general scheduler or a priority model. With three finite jobs, a positive quantum, FIFO tail requeue and no priorities, round-robin makes progress if the 80-tick budget is sufficient. No claim extends to open arrivals or priority starvation. The model omits cache warmth, migrations, interrupts and fairness classes. Temporary state clears on reload, and no grade is saved.

By GOAT Engineer. Explore System Design · Privacy Policy · Contact.