Given 3 programs P0, P1, P2 and two CPUs and each CPU having 2 threads. The running times of the programs take 5, 10 and 20 msecs respectively. How long will it take to execute all 3 programs? Assuming they do not change CPUs and do not block during execution.
My answer is 20 msecs because no matter how we organize the programs on the CPUs they will be completed as fast as the slowest program(P2), therefore 20 msecs. However, the solutions manual gives answers 20, 25 and 30. Can anyone tell me how that answer came to be?
It says
If P0 and P2 are scheduled on same CPU and P1 is scheduled on the other CPU it will take 25 msecs
the question is why though, shouldn't the first CPU take P2 time (20 msecs) and second one P1 and given than P2 takes longer and both CPUs run concurrently shouldn't the answer be 20 msecs as well?