[concurrency-interest] More CompletableFuture internal improvements

Doug Lea dl at cs.oswego.edu
Sat May 24 13:09:21 EDT 2014


The first of various improvements catching up after a very busy semester ...

While addressing the recursion issues in CompletableFuture, I
had a deja vu prediction that someday, someone would create
zillions of useless completion stages for CompletableFuture that
never fired, and then complain about space usage. This can happen
for example with unused sources of anyOf and "either" constructions.
With a fair amount of restructuring, it's possible to clean these out.
Which the updated version does. Comments and experience reports welcome.
(For those familiar with internals: this required merging
"Async" with Completion classes, which turns out to be a good
idea anyway because it further reduces footprint.)

The deja vu comes from similar experiences dealing with
cleanup in cases of time-outs on queues etc every millecond
for days.

Updated sources at

http://gee.cs.oswego.edu/cgi-bin/viewcvs.cgi/jsr166/src/main/java/util/concurrent/CompletableFuture.java?view=log

Also compiled into the jar at
    http://gee.cs.oswego.edu/dl/jsr166/dist/jsr166.jar
that you can run with -Xbootclasspath

-Doug


More information about the Concurrency-interest mailing list