Structured concurrency: still preview
Five previews in, and the API changed again - a deliberate signal worth reading.
Open this lesson in the learning hubKey points
- JEP 505 is the fifth preview of structured concurrency, and the API was reshaped again in 25.
- Task scopes moved to a factory style with joiners, replacing the earlier subclass-based shape.
- The core idea is unchanged: subtasks live and die with the block that started them.
- It stayed preview precisely because the team is still refining ergonomics - that is the process working.
- Use virtual threads and executors in production today; keep structured concurrency in experiments.
An API that reshapes at its fifth preview is telling you plainly not to build production code on it.
This is a reading copy. The full lesson — with the visual explainer, the interactive lab and a Run button for the code — lives in the Java 25 Course course, and every lesson in it is listed on the Java 25 Course contents page.