IOs take 5 time units to complete.
Time PID: 0 PID: 1 CPU IOs 1 RUN:io READY 1 2 WAITING RUN:io 1 1 3 WAITING WAITING 2 4 WAITING WAITING 2 5 WAITING WAITING 2 6 WAITING WAITING 2 7* RUN:io_done WAITING 1 1 8* RUN:cpu READY 1 9 RUN:io READY 1 10 WAITING RUN:io_done 1 1 11 WAITING RUN:cpu 1 1 12 WAITING RUN:cpu 1 1 13 WAITING RUN:io 1 1 14 WAITING WAITING 2 15* RUN:io_done WAITING 1 1 16 RUN:cpu WAITING 1 1 17 RUN:io WAITING 1 1 18 WAITING WAITING 2 19* WAITING RUN:io_done 1 1 20 WAITING RUN:io 1 1 21 WAITING WAITING 2 22 WAITING WAITING 2 23* RUN:io_done WAITING 1 1 24 DONE WAITING 1 25 DONE WAITING 1 26* DONE RUN:io_done 1
Produce a trace of what would happen when you run these processes: Process 0 io io_done cpu io io_done cpu io io_done Process 1 io io_done cpu cpu io io_done io io_done Important behaviors: System will switch when the current process is FINISHED or ISSUES AN IO After IOs, the process issuing the IO will run LATER (when it is its turn) R=READY, C=CPU, I=IO, W=WAITING, D=DONE (CPU = RUN:cpu, IO = RUN:io or RUN:io_done)