Consider a pre-emptive priority processor scheduler. There are three processes P
ID: 3846096 • Letter: C
Question
Consider a pre-emptive priority processor scheduler. There are three processes P1, P2, and P3 in the job mix that have the following characteristics:
Process
Arrival
Time
Priority
Activity
P1
0 sec
1
8 sec CPU burst followed by
4 sec I/O burst followed by
6 sec CPU burst and quit
P2
2 sec
3
64 sec CPU burst and quit
P3
4 sec
2
2 sec CPU burst followed by
2 sec I/O burst followed by
2 sec CPU burst followed by
2 sec I/O burst followed by
2 sec CPU burst followed by
2 sec I/O burst followed by
2 sec CPU burst and quit
Diagram showing process execution:
1) What is the turnaround time for each of P1, P2, and P3?
Solution:
2) What is the average waiting time for this job mix?
Solution:
Process
Arrival
Time
Priority
Activity
P1
0 sec
1
8 sec CPU burst followed by
4 sec I/O burst followed by
6 sec CPU burst and quit
P2
2 sec
3
64 sec CPU burst and quit
P3
4 sec
2
2 sec CPU burst followed by
2 sec I/O burst followed by
2 sec CPU burst followed by
2 sec I/O burst followed by
2 sec CPU burst followed by
2 sec I/O burst followed by
2 sec CPU burst and quit
CPU P1 I/O Time 64 P3 Pl P3 P1 P3 P1 P3 Pl 2 2 2 2 2 2 2 6 P3 P3 P3 P1 2 2 2 2 2Explanation / Answer
1)
turnaround time = completion time - arrival time
P1:
turnaround time = 88 - 0 = 88 sec
P2:
turnaround time = 66 - 2 = 64 sec
P3:
turnaround time = 80 - 4 = 76 sec
2)
Average waiting time :-
waiting time = turnaround time - burst time
P1:
waiting time = 88 - 18 = 70 sec
p2:
waiting time = 64 - 64 = 0 sec
p3:
waiting time = 76 - 14 = 62 sec
averagae waiting time = (70+0+62)/3 = 132 /3 = 44 sec
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.