Professional Documents
Culture Documents
Ayaz 1
Ayaz 1
Program: BSCS
Session: 2017-2021
Semester: 7st Semester
Course Code: CS-206
Course Name: Operating Systems
Instructor: Waqas Sharif
Question No 1
CPU burst time indicates the time; the process needs the CPU. The following are the set of
processes with their respective CPU burst time (in milliseconds). These processes are being
scheduled using a non-preemptive, FSFC scheduling algorithm.
P0 6
P1 8
P2 7
P3 3
Draw a Gantt chart and calculate the turnaround time, response time and average waiting time if
the process arrived in the following order:
Gantt Chart:
P1 P2 P0 P3
0 8 15 21 24
Average waiting Time:
P1=0-0=0
P2=8-1=7
P0=15-2=13
P3=21-3=18
=9.5
Turnaround time:
P1=8-0=8
P2=15-1=14
P0=21-2=19
P3=24-3=21
Response time:
P1=0-0=0
P2=8-1=7
P0=15-2=13
P3=21-3=18
(2)
Gantt chart:
P2 P3 P1 P0
0 7 10 18 24
P2=0-0=0
P3=7-1=6
P1=10-2=8
P0=18-3=15
=7.25
Turnaround Time:
P2=7-0=7
P3=10-1=9
P1=18-2=16
P0=24-3=21
Response time:
P2=0-0=0
P3=7-1=6
P1=10-2=8
P0=18-3=15