Marco Ehrentreich wrote:
your understanding of Future.get() is correct. Calling get() will block your current thread until the computation is finished (additionally you can specify a timeout).
Mohit Chauhan wrote:
It means if i have three threads being executed through Callable/Future service and if first thread is taking much longer , keeping a check early on future with isDone() makes my other threads to work without any blocking or waiting for first thread results.
However if i use the same implementation without isDone() , then my run will be stuck until first thread completes and gets result ?
Did you see how Paul cut 87% off of his electric heat bill with 82 watts of micro heaters? |