This is the CSR for JEP 428: Structured Concurrency (Incubator).
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.
Problem
The Motivation section in the JEP outlines common pitfalls that can arise when writing concurrent code. In particular, a method might spawn a thread to run a subtask, and then return, leaving the subtask running in the background, its lifetime unclear from the code. Alternatively a concurrent subtask might fail, leaving its failure unnoticed and ignored.
Solution
Add a simple API that introduces developers to the concepts of structured concurrency on the one hand, while looking familiar by resembling existing constructs, like ExecutorService on the other. The JEP provides discussion and examples of the proposed solution.
The proposed API is in an incubator module, the module and package name proposed is jdk.incubator.concurrent
.
Specification
The API docs are attached.
- csr of
-
JDK-8284199 Implementation of Structured Concurrency (Incubator)
-
- Resolved
-
- relates to
-
JDK-8306916 Implementation of Structured Concurrency (Preview)
-
- Closed
-
-
JDK-8296780 Implementation of Structured Concurrency (Second Incubator)
-
- Closed
-