Process SchedulerOPERATING SYSTEMS LAB

CPU SCHEDULING SIMULATOR

One CPU. Different decisions.

Explore how scheduling changes the order of execution—and the time each process waits.

Single CPU · zero switch overhead

01 / CONFIGURE

Process queue

Enter process details below. All times use whole-number units.

1–30. Type a count and press Enter, or use + / −. Reducing it removes the last rows.

Round Robin uses q as its time slice.

ProcessArrival timeBurst timePriorityRemove

02 / SIMULATE

First-Come-First-Served

Sample results

Avg. waitingtime units
Avg. turnaroundtime units
Avg. responsetime units

Execution timeline

Step-by-step execution

At time t, burst used and waiting are counted up to t. The CPU shown runs during the next time unit. Final results below cover the complete schedule.

Execution playback controls

Process states at the playback clock, in input order
ProcessStateCPU usedRemainingWait so farPriority

Processes are listed in input order. Use Next event to jump to an arrival, completion, CPU change, or quantum boundary.

CPU utilization Context switches Idle time Throughput

Process results

ProcessArrivalBurstCompletionTurnaroundWaitingResponse

03 / COMPARE

Same workload. Six approaches.

Click an algorithm below to view its timeline and detailed results using your current process inputs. Lower averages are highlighted in green.

AlgorithmAvg. waitingAvg. turnaroundAvg. responseSwitches

Questions & answers: understand the simulation

Inputs and time calculations

What do arrival time and burst time mean?

Arrival time is when a process becomes ready. Burst time is the CPU time it needs. Enter arrival 0 for every process if they all arrive together.

What is completion time (CT)?

CT is the clock time when a process finishes. For example, a process arriving at 2 and finishing at 9 has CT = 9.

How is turnaround time (TAT) calculated?

TAT = CT − arrival time. It includes all time from arrival until completion. In the example above, TAT = 9 − 2 = 7.

How is waiting time (WT) calculated?

WT = TAT − burst time. If TAT is 7 and burst is 4, WT = 3. This is the total time spent ready but not running.

What is response time (RT)?

RT = first start time − arrival time. It measures the wait before the first CPU execution. A preempted process can have a low RT and a much larger total WT.

How are totals and averages calculated?

Total is the sum of a column. Average = total ÷ process count. For waiting times 0, 3 and 6, total WT = 9 and average WT = 3. Total CT is a sum of finish timestamps; it is not elapsed CPU time.

Which inputs affect which algorithms?

Arrival and burst affect all available algorithms. Priority numbers affect the two Priority variants. Quantum affects Round Robin. The comparison uses the same input rows for every algorithm.

How the algorithms choose a process

How does FCFS work?

The earliest arrived ready process runs to completion. Equal arrival times use the order of the input rows.

How does non-preemptive SJF work?

The shortest burst among processes that have already arrived runs to completion. Later arrivals cannot interrupt it.

How does SRTF differ from SJF?

SRTF is preemptive SJF. Every time unit, it chooses the smallest remaining burst. A shorter arriving process can interrupt the current one. Equal remaining times use arrival time, then input order.

What do priority numbers mean?

A smaller number means higher priority. Priority 1 runs before priority 3 when both are ready. Equal-priority dispatch ties use arrival time, then input order.

How do the two Priority variants differ?

Non-preemptive Priority lets the selected job finish. Preemptive Priority interrupts it when a strictly higher-priority job arrives. An equal-priority arrival does not interrupt the current job.

How does Round Robin use the quantum?

Each ready job gets at most q CPU time units. If unfinished, it goes to the back of the ready queue. Jobs arriving during a slice or exactly at its end are added before the current job is requeued.

Reading the chart and comparing results

How do I use step-by-step execution?

Use +1 unit and −1 unit to move the clock, Play to animate, or the slider to inspect any time. Next event skips to a scheduling event. The state table shows CPU time used, remaining burst and waiting so far. At a boundary, arrivals and completions have already been applied, and Running identifies the process selected for the next unit. The main result table always shows final values.

What does the CSV report include?

It includes the selected algorithm, inputs, process results, totals, averages, CPU statistics, the comparison of all available algorithms and the complete execution timeline. Open it in Excel or another spreadsheet app. IDs beginning with spreadsheet formula characters are exported as text. Changed inputs are validated and recalculated before export.

How can I print results or save a PDF?

Click Print / Save PDF. In the browser print dialog, choose your printer or Save as PDF. The report includes the selected algorithm, inputs, final results and comparison. A long timeline is limited to its first 100 segments in print; CSV includes every segment. Playback controls are excluded from the report.

What does the Gantt chart show?

It shows CPU execution order. Each block names a process and its time boundaries; Idle means no process was ready. Adjacent intervals for the same process are merged. Widths have a readability minimum, so use the labels for exact durations.

Why does the timeline sometimes scroll?

Long schedules need room for their time labels. Swipe or scroll inside the chart to see later blocks. A long schedule shows up to 400 segments at a time, with a notice. Playback moves the chart window to the current time; all calculations use the full schedule.

How are CPU utilization and throughput calculated?

Utilization = total burst ÷ elapsed time × 100. Throughput = process count ÷ elapsed time. Elapsed time runs from clock 0 to the final completion, including initial idle time.

What counts as a context switch here?

A direct change from one running process to a different process counts as one switch. The initial dispatch, a transition through Idle, and consecutive slices of the same process do not count. Switching takes zero time in this simulation.

How can I view another algorithm without re-entering inputs?

Click its name in the comparison table, or change the algorithm dropdown. The process inputs stay in place, and its timeline, results, totals and averages appear. If you changed an input, it is recalculated before switching.

Does the green highlight mean an algorithm is always best?

Green marks the lowest average in that column for your current workload, including ties. A different workload or quantum can change the result. Waiting time and response time can favor different algorithms.

What are the limits and assumptions?

This models one CPU and one CPU burst per process, with no I/O blocking. Use 1–30 processes. Arrival: 0–10,000; burst, quantum and priority: 1–10,000. Times are whole-number abstract units. It simulates scheduling; it does not change your computer’s scheduler.