Suppose two jobs, each of which needs 10 min of CPU time, start simultaneously. Assume 50% I/O wait time. How long will it take for both to complete if they run sequentially ?

Suppose two jobs, each of which needs 10 min of CPU time, start simultaneously. Assume 50% I/O wait time. How long will it take for both to complete if they run sequentially ? Correct Answer 40

The correct answer is “option 4”.

Concept:

If any process takes both CPU Time and I/O Time then, the total time taken by the process to complete is:

Total time = CPU Time + I/O Time

Calculation:

Given that the I/O Time of a job is 50% of the Total Time of that job, that means 50% of the time process needs I/O and 50% of the time process needs CPU time.       Also, CPU Time is 10 min.

Hence, 

50% * total time taken by process = CPU Time

0.5 * Total Time = 10 min.

Total time = 10 ÷ 0.5 = 20 min.

Time taken by one process is 20 min then, Total time taken by both processes is

20 min. + 20 min.= 40 min.  

Hence, the total time taken by both processes is 40 min. 

Related Questions