A certain computer system runs in a multi-programming environment using a non-preemptive algorithm. In this system, two processes A and B are stored in the process queue, and A has a higher priority than B. The table below shows estimated execution time for each process; for example, process A uses CPU, I/O, and then CPU sequentially for 30, 60, and 30 milliseconds respectively. Which of the following is the estimated time in milliseconds to complete both A and B? Here, the multi-processing overhead of OS is negligibly small. In addition, both CPU and I/O operations can be executed concurrently, but I/O operations for A and B cannot be performed in parallel.
UNIT : millisecond
CPU I/O CPU
A_______________30___________________60_________________30
B_______________45___________________45__________________--
Please help me.. i need to explain this in front of the class tomorrow but i cant seem get the idea of it...
A has the highest priority, but since the system is non-preemptive, this is only a tiebreaker when both processes need a resource at the same time.
At t=0, A gets the CPU for 30 ms, B waits as it needs the CPU.
At t=30, A releases the CPU, B gets the CPU for 45 ms, while A gets the I/O for 60 ms.
At t=75, the CPU sits idle as B is waiting for A to finish I/O, and A is not ready to use the CPU.
At t=90, A releases I/O and gets the CPU for another 30 ms, while B gets the I/O for 45 ms.
At t=120, A releases the CPU and is finished.
At t=135, B releases I/O and is finished.