CPU and I/O BURST Cycle in Operating System | OS Tutorials YASH PAL, June 4, 2026June 4, 2026 In Operating System process execution consist of a cycle of CPU execution and I/O wait. Processes alternate between these two states. Process execution begins with a CPU burst, which is followed by an I/O burst, which in turn followed by another CPU burst, then another I/O burst and so on. Final CPU burst ends with a system request to terminate as shown in Figure 1.Figure 1: Alternating sequence of CPU and I/O burstThe duration of CPU burst vary greatly from process to process and then from computer to computer. An I/O bound programs typically has many short CPU bursts. A CPU bound program might have a few long CPU bursts.Example 1 – Consder the following set of process with the arrival time and CPU burst time given in milliseconds:ProcessArrival timeCPU burst timeP1024P237P356P41010We need to determine Average Waiting time and Average turn around time with the preemptive SJF scheduling.Solution – As per the given information the resluting preemptive SJF scheduling is depicted in the following Gantt chart:P1P2P3P4P10-33-1010-1616-2626-47As shown in above table process P1 is started at time 0, since it is the only process in the queue. Process P2 arrives at time 3. The remaining time for process P1 (24.3 = 21 miliseconds) is larger than the time required by process P2 (7 miliseconds), so process P1 is preempted and process P2 is scheduled.Similarly, process P3 arrives at time 5. But the remaining time for process P2 (7-2 = 5 miliseconds) is smaller than the time required by process P3(6 miliseconds), so P2 will continue its execution. After P2, the process P3 is scheduled and then P4 and then P1 will continue its execution.Average waiting time = (26−3)+(3−3)+(10−5)+(16−10)4=23+0+5+64=344\frac{(26-3) + (3-3) + (10-5) + (16-10)}{4} = \frac{23+0+5+6}{4} = \frac{34}{4}AWT = 8.5 milisecondsAverage turn around time = Average Waiting Time + Average Execution Time = 8.5 + (47/4) = 20.25 milisecondsExample 2 – Consider the following set of process with the arrival time and CPU burst time given in miliseconds.ProcessesArrival timeCPU burst timeP105P213P323P431What is Average waiting time for these. Process with the preemptie shorts job first scheduling?Solution – Shortest-Job-First-Scheduling: A different approach to CPU scheduling is the Shortest – Job First Scheduling. This algorithm associates with each process the length of the process’s next CPU burst. When the CPU is available, it is assigned to the process that has the smallest next CPU burst. In the next CPU burst of two processes are the same, FCFS scheduling is used to break the tie. Note that more appropriate terms for this scheduling method would be the shortest next CPU – burst algorithm because scheduling depends on the length of the next CPU burst of a process, rather than its total length.From above question SJFS is:P1P2P3P4P5P60-11-33-44-55-88-12Average waiting time = 7+2+0+34=124=3 milliseconds\frac{7+2+0+3}{4} = \frac{12}{4} = 3 \space milliseconds engineering subjects Operating System Operating System