Java's Concurrency Journey Continues! Structured Concurrency & Scoped Values
summary
Java 21 preview demos show Structured Concurrency coordinating virtual threads so subtasks join or short‑circuit: a restaurant example forks waiters, uses shutdownOnFailure to cancel other tasks when one ingredient (each ingredient has ~5% chance to be out) is missing, and uses shutdownOnSuccess to return on first good result. Virtual threads scale to millions of virtual threads, but pin on synchronized/native calls; Scoped Values are introduced as ScopedValues are immutable with limited, inheritable lifetimes and demo code on GitHub.
AI-written summary · about
chapters (9)
- 0:00Introduction and motivation
- 2:13Traditional Java concurrency
- 5:48Executor service challenges
- 10:37Thread locals
- 14:58Virtual threads
- 22:04Structured concurrency
- 33:03Sanity checks on new features
- 35:02Scoped values
- 42:11Practical implications and Q&A
related talks
02h 17mJava's Concurrency Journey Continues! Exploring Structured Concurrency and Scoped Values
57mStructured Concurrency in Java
43mStructured Concurrency in Java - The What and the Why
51mIntroduction and Pitfalls of Java's New Concurrency Model
41mStructured Concurrency in Java: The What & Why
34mIntroduction and pitfalls of Java's new concurrency model
48mMake Your Code Parallel with the Structured Concurrency API
38mIntroduction and pitfalls of Java's new concurrency model
