Process Scheduling Numericals for Practice
FCFS
P1: Arrival Time = 2, Burst Time = 6
P2: Arrival Time = 5, Burst Time = 2
P3: Arrival Time = 1, Burst Time = 8
P4: Arrival Time = 0, Burst Time = 3
P5: Arrival Time = 4, Burst Time = 4
Determine the order of completion, and calculate the average response time, waiting time, and turnaround time for these processes under FCFS scheduling. Draw the corresponding Gantt chart.
SJF (Non-preemptive)
P1: Arrival Time = 3, Burst Time = 4
P2: Arrival Time = 2, Burst Time = 6
P3: Arrival Time = 1, Burst Time = 5
P4: Arrival Time = 0, Burst Time = 9
P5: Arrival Time = 4, Burst Time = 2
Determine the execution order using SJF (non-preemptive) scheduling, and calculate the average response time, waiting time, and turnaround time for these processes. Draw the corresponding Gantt chart.
SRTN (preemptive)
P1: Arrival Time = 2, Burst Time = 3
P2: Arrival Time = 1, Burst Time = 6
P3: Arrival Time = 4, Burst Time = 4
P4: Arrival Time = 6, Burst Time = 5
P5: Arrival Time = 5, Burst Time = 2
Determine the execution order using SRTN scheduling, and calculate the average response time, waiting time, and turnaround time for these processes. Draw the corresponding Gantt chart, considering process preemption.
Priority (non-preemptive)
P1: Arrival Time = 1, Burst Time = 4, Priority = 2
P2: Arrival Time = 3, Burst Time = 6, Priority = 1
P3: Arrival Time = 5, Burst Time = 5, Priority = 3
P4: Arrival Time = 0, Burst Time = 3, Priority = 4
P5: Arrival Time = 2, Burst Time = 2, Priority = 5
Task: Determine the execution order using Priority Scheduling (non-preemptive), and calculate the average response time, waiting time, and turnaround time for these processes. Draw the corresponding Gantt chart.
Priority (preemptive)
P1: Arrival Time = 0, Burst Time = 8, Priority = 3
P2: Arrival Time = 2, Burst Time = 5, Priority = 1
P3: Arrival Time = 4, Burst Time = 3, Priority = 4
P4: Arrival Time = 6, Burst Time = 6, Priority = 2
P5: Arrival Time = 7, Burst Time = 2, Priority = 1
Determine the execution order using Priority Scheduling (preemptive), and calculate the average response time, waiting time, and turnaround time for these processes. Draw the corresponding Gantt chart, including the points of preemption.
Round-robin (time quantum = 2)
P1: Arrival Time = 0, Burst Time = 4
P2: Arrival Time = 1, Burst Time = 5
P3: Arrival Time = 2, Burst Time = 7
P4: Arrival Time = 3, Burst Time = 2
P5: Arrival Time = 4, Burst Time = 1
Determine the execution order using Round Robin scheduling with a time quantum of 2, and calculate the average response time, waiting time, and turnaround time for these processes. Draw the corresponding Gantt chart. Find the total number of context switches (the change of the processor state from idle to running amounts to one context switch too, the processor is idle before the first process arives and goes back to idle after that last process terminates).
Subscribe to my newsletter
Read articles from Jyotiprakash Mishra directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
Jyotiprakash Mishra
Jyotiprakash Mishra
I am Jyotiprakash, a deeply driven computer systems engineer, software developer, teacher, and philosopher. With a decade of professional experience, I have contributed to various cutting-edge software products in network security, mobile apps, and healthcare software at renowned companies like Oracle, Yahoo, and Epic. My academic journey has taken me to prestigious institutions such as the University of Wisconsin-Madison and BITS Pilani in India, where I consistently ranked among the top of my class. At my core, I am a computer enthusiast with a profound interest in understanding the intricacies of computer programming. My skills are not limited to application programming in Java; I have also delved deeply into computer hardware, learning about various architectures, low-level assembly programming, Linux kernel implementation, and writing device drivers. The contributions of Linus Torvalds, Ken Thompson, and Dennis Ritchie—who revolutionized the computer industry—inspire me. I believe that real contributions to computer science are made by mastering all levels of abstraction and understanding systems inside out. In addition to my professional pursuits, I am passionate about teaching and sharing knowledge. I have spent two years as a teaching assistant at UW Madison, where I taught complex concepts in operating systems, computer graphics, and data structures to both graduate and undergraduate students. Currently, I am an assistant professor at KIIT, Bhubaneswar, where I continue to teach computer science to undergraduate and graduate students. I am also working on writing a few free books on systems programming, as I believe in freely sharing knowledge to empower others.