Question: Implement the following CPU scheduling algorithms (FCFS) Process Data: process goes {CPU burst, I/O time, CPU burst, I/O time, CPU burst, I/O time,.., last CPU
Implement the following CPU scheduling algorithms (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}
Write the simulation program in a programming language (such as C, C++).
Sample Output below:
Current Time: 0
Now running: P1 ..................................................
Ready Queue: Process Burst P2 9 P3 24 P4 15 P5 6 P6 22 P7 4 P8 5 ..................................................
Now in I/O: Process Remaining I/O time [empty]
::::::::::::::::::::::::::::::::::::::::::::::::::
Current Time: 4
Now running: P2 ..................................................
Ready Queue: Process Burst P3 24 P4 15 P5 6 P6 22 P7 4 P8 5 ..................................................
Now in I/O: Process Remaining I/O time P1 15
::::::::::::::::::::::::::::::::::::::::::::::::::
Current Time: 13
Now running: P3 ..................................................
Ready Queue: Process Burst P4 15 P5 6 P6 22 P7 4 P8 5 ..................................................
Now in I/O: Process Remaining I/O time P1 6 P2 28
::::::::::::::::::::::::::::::::::::::::::::::::::
Current Time: 37
Now running: P4 ..................................................
Ready Queue: Process Burst P5 6 P6 22 P7 4 P8 5 P1 5 ..................................................
Now in I/O: Process Remaining I/O time P2 4 P3 28
::::::::::::::::::::::::::::::::::::::::::::::::::
Current Time: 52
Now running: P5 ..................................................
Ready Queue: Process Burst P6 22 P7 4 P8 5 P1 5 P2 11 ..................................................
Now in I/O: Process Remaining I/O time P3 13 P4 35
::::::::::::::::::::::::::::::::::::::::::::::::::
Current Time: 58
Now running: P6 ..................................................
Ready Queue: Process Burst P7 4 P8 5 P1 5 P2 11 ..................................................
Now in I/O: Process Remaining I/O time P3 7 P4 29 P5 22
::::::::::::::::::::::::::::::::::::::::::::::::::
Current Time: 80
Now running: P7 ..................................................
Ready Queue: Process Burst P8 5 P1 5 P2 11 P3 12 P5 5 ..................................................
Now in I/O: Process Remaining I/O time P4 7 P6 38
::::::::::::::::::::::::::::::::::::::::::::::::::
Current Time: 84
Now running: P8 ..................................................
Ready Queue: Process Burst P1 5 P2 11 P3 12 P5 5 ..................................................
Now in I/O: Process Remaining I/O time P4 3 P6 34 P7 36
::::::::::::::::::::::::::::::::::::::::::::::::::
Current Time: 89
Now running: P1 ..................................................
Ready Queue: Process Burst P2 11 P3 12 P5 5 P4 14 ..................................................
Now in I/O: Process Remaining I/O time P6 29 P7 31 P8 14
::::::::::::::::::::::::::::::::::::::::::::::::::
Current Time: 94
Now running: P2 ..................................................
Ready Queue: Process Burst P3 12 P5 5 P4 14 ..................................................
Now in I/O: Process Remaining I/O time P1 31 P6 24 P7 26 P8 9
::::::::::::::::::::::::::::::::::::::::::::::::::
Current Time: 105
Now running: P3 ..................................................
Ready Queue: Process Burst P5 5 P4 14 P8 4 ..................................................
Now in I/O: Process Remaining I/O time P1 20 P2 22 P6 13 P7 15
::::::::::::::::::::::::::::::::::::::::::::::::::
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
