Repository navigation
Stepwise 1.4 — CPU scheduling
Stepwise steps into operating systems: a CPU scheduling module, under a new Systems section.
CPU Scheduling (new module)
- Five policies: First-Come First-Served, Shortest Job First, Shortest Remaining Time First (preemptive), Round Robin with a configurable quantum, and non-preemptive Priority.
- One frame per clock tick or scheduler decision, so preemptions, arrivals and idle gaps can be stepped through and scrubbed like everything else in Stepwise.
- The canvas is the classic Gantt strip plus per-process lanes showing each process running, waiting in the ready queue, or not yet arrived — with the live ready queue (in each policy's own order) underneath.
- Fully editable process table: arrival times, burst times, priorities and quantum, with per-process completion, turnaround and waiting times filling in as the schedule runs, and average waiting / average turnaround / context-switch metrics on top.
Verification
12 new tests, 134 passing in total. Every policy's schedule is checked for the basics (each process runs exactly its burst after its arrival, the CPU never idles while work is ready, the reported averages match an independent recomputation); Round Robin is compared tick-for-tick against a reference simulation; and SRTF's claim to fame is enforced — its average waiting time must beat every other policy on randomized instances.