[concurrency-interest] Future.isCompletedNormally Future.isCompletedAbnormally
lukeisandberg at gmail.com
Sat Mar 7 17:27:38 EST 2015
I think these would be pretty useful (isCancelled() is pretty useful), I
would also be interested in efficient methods to get the failure cause of a
future (without paying the cost of an ExecutionException). A lot of time
the executionexception contains no useful information (if a library is
dereferencing a users future), and so i end up discarding the EE or
replacing it with something more useful.
On Thu, Mar 5, 2015 at 11:58 AM, Martin Buchholz <martinrb at google.com>
> Perhaps Doug can explain why isCompletedNormally and isCompletedAbnormally
> landed in ForkJoinTask but no other Future implementation.
> On Thu, Mar 5, 2015 at 11:07 AM, thurstonn <thurston at nomagicsoftware.com>
>> > All of the is* methods would (obviously) have the same happens-before
>> > semantics.
>> But that's deliberate - isDone() can't have any specified memory
>> rules, since
>> the following **doesn't** hold:
>> isDone == true iff isCompletedNormally() == true
> I don't see why that's true. I expect the action in the thread that makes
> the future done (setting result or exceptional value) happens-before
> actions isDone returning true
>> The usefulness of isCompletedNormally() would lie exactly in this, e,g,
>> if (f.isCompletedNormally())
>> do something //all done
>> else if (waitedlongenough())
>> schedule a backup/replacement execution
> I don't think eliding the try/catch block is good motivation.
> Concurrency-interest mailing list
> Concurrency-interest at cs.oswego.edu
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Concurrency-interest