A browser simulator for COM 310 Operating Systems. It shows how one CPU schedules jobs: a job arrives, waits in the ready queue, runs for a clock tick, and finishes when its bursts are gone.
Live site: https://jaredscar.github.io/CPU-Simulator/
Before a run, the page explains the four stages of a job and the scheduler you picked. Changing the algorithm rewrites that lesson.
During a run, the highlighted row is the job on the CPU. That same color is used in the ready queue and the Gantt chart. Each Gantt block is one clock tick, and the number under it is the clock. A gray block means the CPU was idle.
From this folder:
python -m http.server 8080- Simulate plays one clock tick per second.
- Next Step holds the clock so you can read the decision.
- Stop pauses a running simulation.
- Finish runs the rest of the ticks immediately.
- Quantum is the Round Robin time slice. The other algorithms ignore it.
- A job cannot run before its arrival time.
- After it arrives, it waits in the ready queue. That time is its wait time. The front of the line is on the left.
- The scheduler picks one job. The CPU uses up one burst. Utilization is 100% while a job is running, and 0% on an idle tick.
- When no bursts remain, the job is finished. Turnaround is the time from arrival until then.
Waiting and turnaround averages are the usual way to compare schedulers on the same jobs. Lower is better for both.
The CPU runs the job that has been waiting the longest. Once a job starts, it keeps the CPU until every burst is done.
When the CPU is free, it picks the arrived job with the smallest total burst. A job that has started is not interrupted. This needs the burst length ahead of time, which a real interactive system usually does not know.
Like Shortest Job First, but preemptive. If a new job has less time remaining than the job on the CPU, the CPU switches immediately.
Every job gets the CPU for a fixed quantum, then moves to the back of the ready queue. A quantum of 1 switches almost every tick. A larger quantum looks closer to First Come, First Served.
The ready queue is ordered by priority. A higher number is more important. The job on the CPU is not interrupted.
The CPU always runs the highest-priority arrived job. If a more important job arrives, it takes the CPU immediately.
- A higher priority number is more important for both priority algorithms.
- Wait time is time spent in the ready queue, not time on the CPU.
- Turnaround time is the time from arrival until the job is fully done.
- Burst times range from 1 to 10 time units.
- Priority levels range from 0 to 100.
- The simulator schedules one CPU.



