Title: Variance of Processing Time for Different Policies
1Variance of Processing Time for Different Policies
- Assume that there are n processes on the system
and process 1 lt k lt n has processing time equal
to TBk2k. - Compute average response (turnaround) Tt time for
these processes assuming - 1. arrival in ascending order of process numbers
and FCFS schedule, - 2. arrival in descending order of process numbers
and FCFS schedule, - 3. arrival in ascending order of process numbers
and RR schedule with time slice equal to 1,
2Variance of Processing Time for Different Policies
- 4. arrival in descending order of process numbers
and RR schedule with time slice equal to 1. - Compare the difference between Tts of the same
scheduling policy for different orders of
processes. - Exercise recalculate variance of processing time
for TBk k.
3Solution
- Let tw(k) denote the waiting time of process k,
Tw average waiting time. Then
and
Tw
where Tt denotes the average turnaround time
4Solution of Case 1
5Solution of Case 2
6Solution of Case 3
- Let tp(k) denote the processing time for process
k, where 2 lt k lt n
tp(k) tp(k-1) 1 (n - k 1)2k-1
Reason this process in one time unit completes
the round which was last for process k-1, and
then makes 2k-1 additional rounds in RR schedule
compared to process k-1. Each of this additional
rounds has n-k1 processes in it. We also have
tp(1) n 1 because the first round for process
1 takes n units and the last round just one unit.
7Solution of Case 3 continued
so,
and finally,
8Solution of Case 4
- In this case tp(1)2n and for k gt 1
Reason all 2k-1 rounds which process k executes
after process k-1 finished have all n-k1
remaining processes executed before process k
finishes. Hence,
9Solution of Case 4 continued
10Variance of Processing Time for tBkk (Exercise)
11Solution of Case 3 for the Exercise
Let tp(k) denote the processing time of k-th
process, then for kgt1 tp(k) tp(k-1)
n-k2 because process k makes one round in RR
schedule with n-(k-1) processes left and then one
round for the last work unit and clearly tp(1)
1, so
12Solution of Case 4 for the Exercise
In this case tp(1)n and for kgt1 tp(k)
tp(k-1)n-k1 because the round for process k
has n-k1 processes executed before and with it,
so