CPU Scheduling Simulator
Full workspace Line up processes with arrival times, burst lengths and priorities, pick a scheduling algorithm and watch the CPU work through them: the ready queue fills and empties, the Gantt chart grows tick by tick and every waiting, turnaround and response time is worked out for you. Compare all eight algorithms on the same jobs, then export the Gantt chart, a results table for homework, a PDF report or a video.
- FCFS · SJF · SRTF · Round robin
- Priority with aging
- HRRN · MLFQ
- Context-switch cost
- Animated ready queue
- Compare all 8
- Markdown · CSV · PDF · MP4
- Avg wait
- –
- Avg turnaround
- –
- CPU busy
- –
- Switches
- –
Export
Charts and tables use the algorithm and settings you have now. The GIF and videos play the whole schedule from time 0.
Using CPU Scheduling Simulator
Give processes arrival times and bursts, pick an algorithm and watch the CPU schedule them tick by tick.
- The simulator opens on five classic processes under round robin with a quantum of 3, already run to the end. Press Play (or Space) to watch it from time 0.
- The top of the canvas shows the CPU and the ready queue in order; the Gantt chart below grows tick by tick, with a row per process where the light part is time spent waiting.
- Choose an algorithm at the top: FCFS, SJF, SRTF, round robin, priority (with or without preemption), HRRN or a multilevel feedback queue. Set the quantum and the cost of a context switch.
- Edit processes in the Processes tab: name, arrival, burst and priority. Add more, make a random workload or sort them by arrival.
- The Results tab gives start, finish, turnaround, waiting and response time for each process, with the averages, CPU use and context switches.
- The Compare tab runs all eight algorithms on the same processes and highlights the lowest average wait. Click a row to switch to that algorithm.
- Export the Gantt chart as PNG or SVG, a Markdown answer with the chart and table, a PDF report, CSV tables, or a GIF, MP4 or WebM of the schedule running.
Example
Load Starvation and aging: one low-priority job keeps losing the CPU to a stream of higher-priority ones and finishes last. In Settings set aging to 2 and watch it climb the queue and finish far sooner.
Questions & answers
What is the difference between waiting, turnaround and response time?
Turnaround is the whole time from arrival to finish. Waiting is the part of that spent in the ready queue, so turnaround minus burst. Response is how long until the process first gets the CPU.
Which algorithm is best?
It depends on what you value. SJF and SRTF give the lowest average wait but need to know burst lengths and can starve long jobs. Round robin gives fast response and fairness. FCFS is simple but suffers from the convoy effect.
How are ties broken?
When two processes are equal, the one that arrived first wins, then the one higher in the process list. In round robin, a process that just arrived joins the queue before the one whose quantum just ran out.
What does the context-switch cost do?
Each time the CPU changes from one process to another it spends that many ticks switching, shown in grey. A small quantum with a switch cost wastes a lot of time.
How does the multilevel feedback queue work here?
There are three queues with quantum q, 2q and 4q. New processes start at the top; using a whole slice drops a process one level. A higher queue always goes first, and Settings can move everything back to the top every so many ticks.
Can I use it for homework answers?
Yes. Enter the processes from the question, pick the algorithm and export the Markdown answer: it has the Gantt chart, the table of times and the averages. Check the tie-breaking rule your course uses.
Help improve this tool
Report a problem or suggest an improvement
Describe the issue without pasting private tool input. Feedback goes to our admin inbox.
