CPU Scheduling Simulator
Simulate FCFS, SJF, SRJF, LJF, LRTF, HRRN, Priority Scheduling, Round Robin, and Multilevel Feedback Queue. Burst Time means CPU time only.
Process Input Table
I/O format: afterCPU:duration. Example: 3:2, 7:4. Use N/A for no I/O.
Note: Burst Time means total CPU time only. I/O time is not counted inside Burst Time; it only blocks the process before it continues its remaining CPU burst.
| Color | Process | Arrival Time | Burst Time | I/O | Action |
|---|---|---|---|---|---|
Gantt Charts
CPU and I/O share the same timeline and scrollbar.
CPU Gantt Chart
I/O Gantt Chart
Ready Queue
Run the simulation first.
Step Timeline
Run the simulation first.
I/O / Blocked
None
Completed
None
Avg Turnaround
—
Avg Waiting
—
Avg Response
—
Context Switches
—
CPU Busy Time
—
Final Result Table
Run the simulation first.
Definitions
1. Burst Time
Burst Time means the total CPU time required by a process. I/O time is not counted inside Burst Time. If a process has Burst Time 8 and does I/O for 3 units, the Burst Time is still 8, not 11.
2. Arrival Time
Arrival Time is the time when a process enters the ready queue for the first time. A process cannot be selected by the CPU before its arrival time.
3. I/O Request
When a process requests I/O, it leaves the ready queue and becomes blocked. After the I/O finishes, the process returns to the ready queue with its remaining CPU time.
4. Completion Time
Completion Time is the time when a process fully finishes all its required CPU execution. I/O can delay completion, but it does not reduce or increase the original Burst Time.
5. Turnaround Time
Turnaround Time = Completion Time - Arrival Time. It shows the total time the process stayed in the system.
6. Waiting Time
Waiting Time is the time a process spends waiting in the ready queue. In this simulator, I/O time is subtracted because the process is not waiting for CPU while it is doing I/O.
7. Response Time
Response Time = First CPU Start Time - Arrival Time. It measures how long the process waits before getting the CPU for the first time.
8. Context Switch
A context switch happens when the CPU changes from one process to another process. Switching from idle to a process is usually not counted as a context switch in this simulator.
9. FCFS
First Come First Serve selects the process that arrived first. It is simple, but it can cause long waiting time if a long process comes before short processes.
10. SJF Non-Preemptive
Shortest Job First selects the ready process with the smallest Burst Time. Once a process starts, it continues until it finishes or requests I/O.
11. SJF Preemptive
SJF Preemptive checks the ready queue repeatedly and chooses the process with the shortest total Burst Time. A newly arrived shorter job can preempt the currently running process.
12. Shortest Remaining Job First
Shortest Remaining Job First chooses the process with the lowest remaining CPU time. It is preemptive, so the running process can be stopped if another process has less CPU time remaining.
13. Preemptive Priority Scheduling
Preemptive Priority Scheduling chooses the process with the highest priority. In this simulator, a lower priority number means higher priority. A newly arrived higher-priority process can preempt the current process.
14. Longest Job First
Longest Job First selects the ready process with the largest Burst Time. It is non-preemptive, so once a process starts, it continues until it finishes or requests I/O.
15. Longest Remaining Time First
Longest Remaining Time First selects the ready process with the largest remaining CPU time. It is preemptive, so a process can be stopped if another process has more remaining CPU time.
16. Highest Response Ratio Next
Highest Response Ratio Next chooses the process with the highest response ratio: (Waiting Time + Burst Time) / Burst Time. It helps balance short jobs and long-waiting jobs.
17. Priority Round Robin
Priority Round Robin first chooses the highest-priority ready process. Processes with the same priority are then scheduled using Round Robin.
18. Round Robin
Round Robin gives each process a fixed time quantum. If the process does not finish within that quantum, it goes back to the end of the ready queue.
19. Multilevel Feedback Queue
Multilevel Feedback Queue uses multiple ready queues. A process may move to a lower queue after using its quantum. In the final queue, if the quantum ends, the process is added back to the end of the same final queue until it fully completes.
20. I/O Promotion in MLFQ
When the I/O promotion option is enabled, a process that completes I/O is promoted one queue level upward. This is useful for giving better response to I/O-bound processes.
