1.
Use exponential averaging to predict the size of the next CPU burst.
Use
α
=0.75.
(a) (10 points) At time 5, the predicted CPU burst was 8 but the actual CPU burst was 4.
What is the prediction for time 6?
T
n+1
=
α
t
n
+ (1
α
)T
n
T
6
=(0.75)4 + (10.75)8 = 3+2 = 5
(b) (10 points) At time 6, the actual CPU burst was 12.
What is the prediction for time 7?
T
7
=(0.75)12 + (10.75)5 = 9+1.25=10.25
2.
(a) (10 points) What is the average waiting time and the average turnaround time of the
following Gantt chart where processes P
1
and P
2
arrive at time 0, processes P
3
and P
4
arrive at
time 6, and process P
5
arrives at time 8.
Average waiting time:
(0+5+9+6+0)/5 = 4
Average turnaround time:
(5+8+15+9+4)/5 = 8.2
(b) (10 points) What is the average waiting time and the average turnaround time of the
following Gantt chart where the processes P
1
and P
2
arrive at time 0, process P
3
arrives at
time 3, process P
4
arrives at time 12, and process P
5
arrives at time 16.
Average waiting time:
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
This is the end of the preview.
Sign up
to
access the rest of the document.
 Fall '07
 Dr.Li
 Operating Systems, Bar chart, AirTrain Newark, wait time

Click to edit the document details