Java FutureTask

preview_player
Показать описание
This video gives an overview of the Java FutureTask and shows an example of using FutureTask in the Memoizer class from the "Java Concurrency in Practice" book.
Рекомендации по теме
Комментарии
Автор

Prof Doug,
I was looking at the Memorizer implementation in JCIP book(5.19)
I was thinking that if the compute() is returning the actual Value V, not the future<V>, then there is no possibility of CancellationException being thrown.
This exception can be seen only in following cases
1)if the code retruns Future<V>) and client calls future.cancel() which is not the case as the code doesn't return Future
2)The underlying Futuretask is actually throwing CancellationException which is also not the case here.

Please let me know if I am missing something.

SanjeevKumar-hjfb
join shbcf.ru