What if there was no future.isDone check in the invokeAll method
If we check the invokeAll method in AbstractExecutorService class, then we can see that following things are happening:
If we check the get method in CompletableFuture, then we see that the get method will return the result immediately if the computation is complete, else will wait until the result is available.
My question is - is the check in point (2) for checking the completion status using isDone() method of future redundant? Would there be no effect if we remove this check?
链接地址: http://www.djcxy.com/p/50192.html