Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8132960

JEP 266: More Concurrency Updates

    Details

    • Author:
      Doug Lea
    • JEP Type:
      Feature
    • Exposure:
      Open
    • Subcomponent:
    • Scope:
      SE
    • Discussion:
      core dash libs dash dev at openjdk dot java dot net
    • Effort:
      S
    • Duration:
      S
    • Alert Status:
       Green
    • Alert Reason:
      Due date extended to accomdate SQE testing
    • JEP Number:
      266

      Description

      Summary

      An interoperable publish-subscribe framework, enhancements to the CompletableFuture API, and various other improvements.

      Motivation

      The continual evolution of uses of concurrency and parallelism in applications requires continual evolution in library support.

      Description

      1. Interfaces supporting the Reactive Streams publish-subscribe framework, nested within the new class Flow. Publishers produce items consumed by one or more Subscribers, each managed by a Subscription. Communication relies on a simple form of flow control (method Subscription.request, for communicating back pressure) that can be used to avoid resource management problems that may otherwise occur in "push" based systems. A utility class SubmissionPublisher is provided that developers can use to create custom components.
        These (very small) interfaces correspond to those defined with broad participation (from the Reactive Streams initiative) and support interoperability across a number of async systems running on JVMs. Nesting the interfaces within a class is a conservative policy allowing their use across various short-term and long-term possibilities. There are no plans to provide network- or I/O-based java.util.concurrent components for distributed messaging, but it is possible that future JDK releases will include such APIs in other packages.

      2. Enhancements to the CompletableFuture API

        • Time-based enhancements are added that enable a future to complete with a value or exceptionally after a certain duration, see methods orTimeout and completeTimeout. In addition, a complementary Executor returned by the static methods named delayedExecutor allow a task to execute after a certain duration. This may be combined with Executor receiving methods on CompletableFuture to support operations with time-delays.
        • Subclass enhancements are added making it easier to extend from CompletableFuture, such as to provide a subclass that supports an alternative default executor.
      3. Numerous implementation improvements accumulated since JDK 8; many of them are small, but some include Javadoc spec rewordings.

      Testing

      The continuing set of JSR 166 EG members provide functionality, TCK, and performance tests for all components.

      Risks and Assumptions

      Care will be taken to ensure any small but required differences in code between the JDK 9 repository and the 166 repository are retained.

        Issue Links

          Activity

          Show
          martin Martin Buchholz added a comment - http://cr.openjdk.java.net/~martin/webrevs/openjdk9/jsr166-jdk9-integration/
          Hide
          martin Martin Buchholz added a comment -
          As expected, the effort to integrate this is causing some rework. Relevant rework changes to jsr166 CVS can be seen like this:

          (cvs -Q -d ':pserver:anonymous@gee.cs.oswego.edu/home/jsr166/jsr166' checkout jsr166 && cd jsr166 && cvs diff -D 2015-09-23 src/{test/jtreg,main})
          Show
          martin Martin Buchholz added a comment - As expected, the effort to integrate this is causing some rework. Relevant rework changes to jsr166 CVS can be seen like this: (cvs -Q -d ':pserver: anonymous@gee.cs.oswego.edu /home/jsr166/jsr166' checkout jsr166 && cd jsr166 && cvs diff -D 2015-09-23 src/{test/jtreg,main})
          Hide
          martin Martin Buchholz added a comment -
          All planned changes are now integrated from jsr166 CVS into openjdk9.

          Many tck changes were also made as part of this integration; they still need to be integrated into jck 9.

          There are a few bugs that deserve a backport to openjdk8. None of the source files integrated have dependencies on jdk9 features, so jdk8 backports should be relatively simple, except for the sheer size of changes. I volunteer to review and/or help backports but not necessarily to actually do them.

          Very many tests were run during the integration process, but all on Linux. Many very rare test failures due to obscure test bugs or insufficient timeouts have been fixed.
          Show
          martin Martin Buchholz added a comment - All planned changes are now integrated from jsr166 CVS into openjdk9. Many tck changes were also made as part of this integration; they still need to be integrated into jck 9. There are a few bugs that deserve a backport to openjdk8. None of the source files integrated have dependencies on jdk9 features, so jdk8 backports should be relatively simple, except for the sheer size of changes. I volunteer to review and/or help backports but not necessarily to actually do them. Very many tests were run during the integration process, but all on Linux. Many very rare test failures due to obscure test bugs or insufficient timeouts have been fixed.

            People

            • Assignee:
              psandoz Paul Sandoz
              Reporter:
              dl Doug Lea
              Owner:
              Doug Lea
              Reviewed By:
              Chris Hegarty, Martin Buchholz, Paul Sandoz
              Endorsed By:
              Brian Goetz
            • Votes:
              0 Vote for this issue
              Watchers:
              12 Start watching this issue

              Dates

              • Due:
                Created:
                Updated:
                Resolved:
                Integration Due: