Please assist with problem below. Please label answer with associated number. Pl
ID: 3856590 • Letter: P
Question
Please assist with problem below. Please label answer with associated number. Please use the layout provided in your answer.
Please answer accurately and claarly....
#1.
Analyze the performance of three scheduling mechanisms: Exponential Averaging, MLFQ, and true ShortestBurstFirst. Calculate the Average Completion Time AND count the number of context switches. The workload consists of the following:
P1: 10(3,2,4); P2: 4(2,6); P3: 16(2,4,5,6). I/O between bursts for 4 time quantums. Exp Ave default =2, alpha=0.6
MLFQ: 3 queues of 2,3 and 4 quantums for the queues. Processes are executed in FIFO order within each queue.
Executing (initial pred=2, alpha =0.6)
Time
0
Exec
Ready
1,2,3
P1
2
P2
2
P3
2
I/O:4
Ave Ave Averagecompletion time = Context switches =
MLFQ: Executing in Queues
Time
0
Q1:1
Q2:2
Q3:4
MLFQ: In Queues
Q1
1,2,3
Q2
Q3
IO:4
Ave AverageCompletion Time = Context switches =
True SJF:
Time
0
Executing
ReadyQ
1,2,3
I/O:4
Completion time ave = . Context switches = .
Executing (initial pred=2, alpha =0.6)
Time
0
Exec
Ready
1,2,3
P1
2
P2
2
P3
2
I/O:4
Explanation / Answer
Alright, so after reviewing with the professor, this is how this actually works.
The default of 2 means they all have an equal priority and just get run in order; process P1, P2, and P3.
Now, once we see P1 run for 3 quantums after the first burst, then we calculate its new prediction.
(0.6) * 2 [original default] + (0.4) * 3 [last run] = 1.2 + 1.2 = Prediction of 2.4
Same thing with P2 & P3 (both have a first burst of 2 quantums.)
(0.6) * 2 [original default] + (0.4)* 2 [last run] = 1.2 + 0.8 = Prediction of 2.0
So for the next quantums' order, it would be P2, P3, THEN P1.
Then after that run you would just do;
(0.6) * [2nd to last burst] + (0.4) * [last burst] = new prediction to figure out which proces would run next.
So the actual order would be;
Quantum: Process
Q3: P1:3
Q5: P2:2
Q7: P3:2
Q8: P2:2 (FINISHES)
Q12: P3:3
Q14: P1:2
Q19: P3:5
Q24: P1:5 (FINISHES)
Q30: P3:6 (FINISHES)