More precisely : If I start async computation by calling submit(Callable<T> task)
method on an ExecutorService
(itself constructed with Executors.newCachedThreadPool()
), I can wait for the computation to finish and retrieve the result by calling Future.get()
.
My question is : if the computation is already finished, what happens until I call get()
? Does the thread is blocked until I retrieved the result? Does the result is stored and the thread assigned to another task? Something completely different?
Thanks in advance for you answers