Give: What is the likely result?
A.
The program produces the correct result, with similar performance to the original.
B.
The program produces the correct result, with performance degraded to the equivalent of
being single threaded.
C.
The program produces an incorrect result.
D.
The program goes into an infinite loop.
E.
An exception is thrown at runtime.
F.
The program produces the correct result, with better performance than the original.
The question is missing the following instructions :
”
if you replace line X by :
return f1.join() + f2.compute() ;
”
What is likely the result ?
Answer D is wrong.
But the performance decreases a lot (answer B)
Why the change will decrease performance????
The correct Answer is the B :
The program produces the correct result, with performance degraded to the equivalent of
being single threaded.
if you check the code, you will see that the performance is low