Skip to content
The Computer Science
TheCScience
  • Engineering Subjects
    • Human Values
    • Computer System Architecture
    • Microprocessor
    • Digital Communication
    • Internet of Things
  • NCERT Solutions
    • Class 12
    • Class 11
  • Solutions
    • HackerRank
      • C Solutions
      • C++ Solutions
      • Java Solutions
      • Python Solutions
      • Algorithms Solutions
      • Data Structures Solutions
    • HackerEarth Solutions
    • Leetcode Solutions
  • JEE 2027
The Computer Science
TheCScience

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.

CPU and Input Output Burst Cycle
Figure 1: Alternating sequence of CPU and I/O burst

The 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 time
P1024
P237
P356
P41010

We 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:

P1P2P3P4P1
0-33-1010-1616-2626-47

As 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 miliseconds

Average turn around time = Average Waiting Time + Average Execution Time = 8.5 + (47/4) = 20.25 miliseconds

Example 2 – Consider the following set of process with the arrival time and CPU burst time given in miliseconds.

ProcessesArrival timeCPU burst time
P105
P213
P323
P431

What 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:

P1P2P3P4P5P6
0-11-33-44-55-88-12

Average 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

Post navigation

Previous post

Leave a Reply

Your email address will not be published. Required fields are marked *

Engineering Core Subjects

Digital Communication Subject
Internet of Things Subject
Computer Architecture subject
Human Value Subject

JEE Study Materials

JEE Physics Notes
JEE Chemistry Notes

TheCScience

At TheCScience.com, our mission is to make quality education accessible to everyone. We provide in-depth, easy-to-understand articles covering Secondary, Senior Secondary, and Graduation-level subjects.

Pages

About US

Contact US

Privacy Policy

DMCA

Our Tools

Hosting - get 20% off

Engineering Subjects

Internet of Things

Human Values

Digital Communication

Computer System Architecture

Microprocessor

Programming Tutorials

Data Structure and Algorithm

C

Java

NCERT

Class 12th

©2026 TheCScience | WordPress Theme by SuperbThemes