Question: Do not ask user for input (i.e asking user to enter number of processes) . Please use C++ (Multilevel Feedback Queue) Each process will include
Do not ask user for input (i.e asking user to enter number of processes) . Please use C++ (Multilevel Feedback Queue)
Each process will include at least: a list of CPU bursts (possibly in an array alone or combined with I/O times) a list of I/O times ( possibly in an array) a current CPU burst and a current I/O time variables to store the response time, waiting time, and turnaround time
During execution each process will be in one of 3 states: Ready (accumulating wait time) Executing (using current CPU time) Blocking (using current I/O time)
MLFQ (partial results provided) Multilevel Feedback Queue (preemptive absolute priority in higher queues) Queue 1 uses RR scheduling with Tq = 6 Queue 2 uses RR scheduling with Tq = 12 Queue 3 uses FCFS
Process Data: process goes {CPU burst, I/O time, CPU burst, I/O time, CPU burst, I/O time,.., last CPU burst} P1 { 4, 15, 5, 31, 6, 26, 7, 24, 6, 41, 4, 51, 5, 16, 4}
P2 { 9, 28, 11, 22, 15, 21, 12, 28, 8, 34, 11, 34, 9, 29, 10, 31, 7}
P3 { 24, 28, 12, 21, 6, 27, 17, 21, 11, 54, 22, 31, 18}
P4 { 15, 35, 14, 41, 16, 45, 18, 51, 14, 61, 13, 54, 16, 61, 15}
P5 { 6, 22, 5, 21, 15, 31, 4, 26, 7, 31, 4, 18, 6, 21, 10, 33, 3}
P6 { 22, 38, 27, 41, 25, 29, 11, 26, 19, 32, 18, 22, 6, 26, 6}
P7 { 4, 36, 7, 31, 6, 32, 5, 41, 4, 42, 7, 39, 6, 33, 5, 34, 6, 21, 9}
P8 { 5, 14, 4, 33, 6, 31, 4, 31, 6, 27, 5, 21, 4, 19, 6, 11, 6}
All processes enter first queue 1. If time quantum (Tq) expires before CPU burst is complete, the process is downgraded to next lower priority queue. Processes are not downgraded when preempted by a higher queue level process. Once a process has been downgraded, it will not be upgraded.
Example of Output Structure
Current Time: 0
Now running: P1 ..................................................
Ready Queue: Process Burst Queue P2 9 Q1 P3 24 Q1 P4 15 Q1 P5 6 Q1 P6 22 Q1 P7 4 Q1 P8 5 Q1 ..................................................
Now in I/O: Process Remaining I/O time [empty]
::::::::::::::::::::::::::::::::::::::::::::::::::
Current Time: 4
Now running: P2 ..................................................
Ready Queue: Process Burst Queue P3 24 Q1 P4 15 Q1 P5 6 Q1 P6 22 Q1 P7 4 Q1 P8 5 Q1 ..................................................
Now in I/O: Process Remaining I/O time P1 15
::::::::::::::::::::::::::::::::::::::::::::::::::
...
Current Time: 743
Now running: [idle] ..................................................
Ready Queue: Process Burst [empty] ..................................................
Now in I/O: Process Remaining I/O time [empty] ..................................................
Completed: P1, P2, P3, P4, P5, P6, P7, P8
::::::::::::::::::::::::::::::::::::::::::::::::::
Finished
Total Time: 743 CPU Utilization: 89.2328%
Waiting Times P1 P2 P3 P4 P5 P6 P7 P8 43 105 373 178 122 395 98 85 Average Wait: 174.875
Turnaround Times P1 P2 P3 P4 P5 P6 P7 P8 288 424 665 647 385 743 466 318 Average Turnaround: 492
Response Times P1 P2 P3 P4 P5 P6 P7 P8 0 24 343 37 13 225 4 8 Average Response: 81.75
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
