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

Implementation of Structured Concurrency (Preview)

XMLWordPrintable

    • Icon: CSR CSR
    • Resolution: Approved
    • Icon: P3 P3
    • 21
    • core-libs
    • None
    • minimal
    • Developers using the incubator API will need some code and command line changes to use the preview API.
    • Java API
    • SE

      Summary

      Add a basic API for "Structured Concurrency". Structured concurrency treats multiple tasks running in different threads as a single unit of work, thereby streamlining error handling and cancellation, improving reliability, and enhancing observability. The API is proposed as a preview API. It previously incubated as JEP 428 and JEP 437.

      Problem

      The goal of this feature is unchanged, that is the goal is to improve the maintainability, reliability, and observability of multithreaded code, in a style that eliminates common risks arising from cancellation and shutdown.

      Solution

      The preview APIs proposed are:

      java.util.concurrent.StructuredTaskScope
      java.util.concurrent.StructuredTaskScope.Subtask
      java.util.concurrent.StructuredTaskScope.Subtask.State
      java.util.concurrent.StructuredTaskScope.ShutdownOnSuccess
      java.util.concurrent.StructuredTaskScope.ShutdownOnFailure
      java.util.concurrent.StructureViolationException

      In conjunction with JEP 446, remove module jdk.incubator.concurrent.

      Specification

      A zip file with the spec diff is attached. This issue is also linked to online API docs to make it easier to look at.

            alanb Alan Bateman
            alanb Alan Bateman
            Paul Sandoz, Ron Pressler
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: