[concurrency-interest] Executor framework adjustments

Doug Lea dl@cs.oswego.edu
Fri, 5 Dec 2003 10:03:26 -0500


Just as official JCP public review period is coming to a close, we
made a few API adjustments in the Executor framework that were
primarily motivated by some very recent planned J2EE efforts -- the
proposed JSR-236 and JSR-237 -- but make good sense in other contexts
as well.

For background, see
  http://www.jcp.org/en/jsr/detail?id=236
  http://www.jcp.org/en/jsr/detail?id=237
And follow links near the bottom of each to see BEA and IBM's proposed
APIs.

The JSR-166 changes are both straightforward:
  * ScheduledExecutor has been made into an interface, not class,
    and the concrete version is renamed ScheduledThreadPoolExecutor
    (This better enables alternative implmentations of the schedule
    methods.)

  * The "Cancellable" and "Future" interfaces (along with default Task
    implementations) have been merged (as Future and FutureTask). The
    initial idea was to enable different implementations based on
    Runnables vs Callables.  But this provided no real value (and the
    performance differences are not noticeable) and unnecessarily
    complicates both usage and layered APis.

These changes should simplify J2EE adaptations and extensions.

Doing this also entailed a couple of other boring changes.

As always, reactions would be welcome.

These changes apparently won't make it into the first early-access or
beta releases of Sun J2SE1.5, but should make it in the following
versions. However, we've put instructions on how to cope at
  http://gee.cs.oswego.edu/dl/concurrency-interest/index.html
where it now says:

  There is a lag between JSR166 spec changes and integration into Sun
  J2SE1.5. If you are running an early access or beta version of 1.5,
  you can make sure you are running the current versions listed in the
  javadocs on this site by getting the jar file at
  http://gee.cs.oswego.edu/dl/concurrent/dist/jsr166.jar, and run using:
    java -server -Xbootclasspath/p:/somepath/jsr166.jar Program
  (The "server" option is not strictly needed but is highly recommended
  for concurrent programs.)

-Doug