For the following three jobs: P1: 10 (3,2,5); P2: 4 (2,2); P3: 16 (2,3,5,6) Exec
ID: 3854631 • Letter: F
Question
For the following three jobs:
P1: 10 (3,2,5); P2: 4 (2,2); P3: 16 (2,3,5,6) Execute the three jobs using Exp Ave and MLFQ. (Please note: This sentence provides instructions on what needs to be done The first problem is P1. Use the two formulas below to execute for each, P1, P2 and P3) (Please let me know if you need additional info.)
ExpAve: Alpha =0.6, default=2.
MLFQ: three queues: queue time quantums of q1=1, q2=2, q3=4.
For both ExpAve and MLFQ, a process that exits the system due to a completed burst (to wait to do I/O), returns to the system after a wait of 2 time quantums. A returning processes does NOT preempt the current process or queue that is executing. For the MLFQ, the returning process returns in Q1.
Explanation / Answer
given jobs for processes :
P1: 10 (3,2,5);
P2: 4 (2,2);
P3: 16 (2,3,5,6)
Execution of 3 jobs using Exp Ave:
given alpha = 0.6 ,
default (pn )= 2 ,
pn+1 = alpha * tn + (1-alpha )* pn
tn is the current process execution time.
for process p1 : (3,2,5) , t1 = 3 , t2 = 2 , t3=5
if n=1; p2 = 0.6 * 3 +(1- 0.6) * 2 = 1.8 + 0.8 = 2.6
if n=2; p3 = 0.6 * 2 +(1- 0.6) * 2.6 = 1.2 + 1.04 = 2.24
if n=3; p2 = 0.6 * 5 +(1- 0.6) * 2.24 = 3 + 0.896 = 3.896
for process p2 : (2,2) , t1 = 2 , t2 = 2
if n=1; p2 = 0.6 * 2 +(1- 0.6) * 2 = 1.2 + 0.8 = 2.0
if n=2; p3 = 0.6 * 2 +(1- 0.6) * 2.0 = 1.2 + 0.8 = 2.0
for process p3 : (2,3,5,6) ,t1=2, t2 = 3 , t3=5 ,t4=6
if n=1; p2 = 0.6 * 2 +(1- 0.6) * 2 = 1.2 + 0.8 = 2.0
if n=2; p3 = 0.6 * 3 +(1- 0.6) * 2.0 = 1.8 + 0.8= 2.6
if n=3; p2 = 0.6 * 5 +(1- 0.6) * 2.6 = 3 + 1.04 = 4.04
if n=4; p3 = 0.6 * 6 +(1- 0.6) *4.04 = 3.6 + 1.616 = 5.216
-> given that to wait or to do , system waits 2 time quantums . and returning processes does NOT preempt the current process or queue that is executing.
-> 3 processes execution on time graph:
-> here e refers executing the process in that time cycle
process p1 execution completed at time cycle 23,
process p2 execution completed at time cycle 9,
process p1 execution completed at time cycle 30,
Therefore average execution time =( 23+ 9 + 30 )/3 = 20.66
Execution of 3 jobs using MLFQ:
given jobs for processes :
P1: 10 (3,2,5);
P2: 4 (2,2);
P3: 16 (2,3,5,6);
three queues: queue time quantums of q1=1, q2=2, q3=4.
the execution table for 3 processes using MLFQ
->first queue has 1 quantum cycle so each process executes 1 cycle in Q1.
->2nd Queue has 2 cycles.so each process can do maximum 2 cycles to execute in Q2.
->until cycle 14 ,execution is normal.
-> Since 2nd process has completed its execution at cycle 12.process P3 leaves for I/O waits until 17th cycle.next in 18 th cycle P3 starts its execution until 20th.
-> Next 2ist and 22nd cycles finishes the execution of process P1.
-> After 24th cycle process P3 again leaves for I/O waits until 25th cycle.next in 26 th cycle P3 starts its execution and finidhes in 32nd cycle.
process p1 execution completed at time cycle 22,
process p2 execution completed at time cycle 12,
process p1 execution completed at time cycle 32,
Therefore average execution time =( 22+ 12 + 32 )/3 = 22
T 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 P1 e e e e e e e e e e P2 e e e e P3 e e e e e e e e e e e e e e e eRelated Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.