Consider the following set of processes on a single-processor system. Process Na
ID: 3592950 • Letter: C
Question
Consider the following set of processes on a single-processor system. Process Name P1 ArrivalTime CPU Burst Len 15 12 P3 17 Show the Gantt chart for a system with multi-level feedback queue with the following rules (make sure to show process preemption and completion times) A newly ariving process joins the Q2 (higher priority Q). where Round Robin scheduling with Quantum Size 4 is used. If a process from the Q2 does not complete within its first time quantum, it is demoted to the Q1 where Round Robin scheduling policy with Quantum Size 8 is used. The processes in Q2 have higher priority than processes in Q1 You will assume preemptive scheduling when solving this problem.Explanation / Answer
In the Above question there are 2 Queue Mention
Q1: P1, P2, P3, P4 Time Quantum is: 8
Q2:P5 Time Quantum is: 4 Q2 Priority is more the Q1
Now In the Question it is not mention that at what time process P5 arrive in queue to.
We are assuming that Process P5 arrives at t=0 time in Queue Q2.
Case I:
CPU Burst time of P5 is not mention in the question, so we are assuming that P2 has burst time of 8 sec.
Process
Arrive
CPU Burst
P1
0
15
P2
1
12
P3
6
3
P4
17
5
Process
Arrive
CPU Burst
P5
0
8
Gantt chart
P5(4)
P1(8)
P2(8)
P3(3)
P4(5)
P5(4)
P1(7)
P2(4)
0 4 12 20 23 28 32 39 43
Case II
We are assuming that Process P5 arrives at t=4 time in Queue Q2.
CPU Burst time of P5 is not mention in the question, so we are assuming that P2 has burst time of 08sec.
Gantt chart
P1(4)
P5(4)
P1(4)
P2(8)
P3(3)
P4(5)
P5(4)
P1(7)
P2(4)
0 4 8 12 20 23 28 32 39 43
In case II we Preempt CPU from P1 and give it to P5, because P5 has More Priority than Q1 Queue,
Once P5 time quantum is finish, we move to Q1 and start from where we left therefore P1 complete 4 sec first after that P5 completed 4 second because its time quantum is 4 second, now P5 CPU burst time is remaining 4 more second.
Process
Arrive
CPU Burst
P1
0
15
P2
1
12
P3
6
3
P4
17
5