[cs33211] Project 2 computing average wait time and turnaround time
Dianne Foreback
dforebac at kent.edu
Fri Mar 17 16:51:20 EDT 2017
Hello OS Class:
Project 1 output has a slight mistake for the FCFS average turnaround
time. It should be 22.67.
I've had a couple questions on how to compute the average wait time and
average turnaround time. My explanation relates to the FCFS scheduling
algorithm using the input from project 1.
pid arrival burst
---------------------
1 0 10
2 0 9
3 3 5
4 7 4
5 10 6
6 10 7
The average wait time is the average amount of time each process waits in
the readyQ.
So, for each process the wait time is the time the process gets access to
the CPU minus
the time the process arrives.
P1 wait time is (0 - 0) = 0
P2 wait time is (10 - 0) = 10
P3 wait time is (19-3) = 16
P4 wait time is (24-7) = 17
P5 wait time is (28-10) = 18
P6 wait time is (34-10) = 24
To get the average, add all of these together and divide by 6:
(0+10+16+14+18+24)/6 = 14.17
The average turnaround time is the average amount of time that it takes
from the time it is
submitted to the time it finishes. So, for our project, this is the
average amount of time starting from when the process finishes minus the
time the process arrives.
P1 turn around time = (10-0) = 10
P2 turn around time = (19-0) = 19
P3 turn around time = (24-3) = 31
P4 turn around time = (28-7) = 21
P5 turn around time = (34-10) = 24
P6 turn around time = (41-10) = 31
To get the average, add all of these together and divide by 6:
(10 + 19+31+21+24+31)/6 = 22.67
Best,
Dianne
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://listmail.cs.kent.edu/pipermail/cs33211/attachments/20170317/75957948/attachment.html
More information about the cs33211
mailing list