Java's Concurrency Journey Continues! Exploring Structured Concurrency and Scoped Values
summary
Demonstrations show virtual threads running ~950,000 vs ~8,000 platform threads on an M1 and yielding about 35–40% throughput improvement for I/O-heavy workloads. The code builds restaurant and bar demos that implement structured concurrency scopes (shutdown-on-failure and shutdown-on-success) so a failed starter cancels other subtasks and the first-success returns the winner. Scoped values replace ThreadLocals with immutable, lexically bounded bindings; inheritance works safely under structured scopes.
AI-written summary · about
chapters (16)
- 0:00Introduction
- 3:33The illusion of multitasking
- 8:30The wrong moment
- 10:25The Restaurant Domain
- 13:25Creating a Restaurant
- 21:05Threats
- 26:55Java Thread
- 28:40Executive Service
- 31:40Executive Service Improvements
- 36:43Unrestricted Concurrency
- 38:55completableFutures
- 39:51Example
- 43:12Threat Local
- 45:40Announcement Local
- 50:08Pros and Cons
- 53:39Honorable Mentions
related talks
49mJava's Concurrency Journey Continues! Structured Concurrency & Scoped Values
57mStructured Concurrency in Java
51mIntroduction and Pitfalls of Java's New Concurrency Model
34mIntroduction and pitfalls of Java's new concurrency model
43mStructured Concurrency in Java - The What and the Why
41mStructured Concurrency in Java: The What & Why
38mIntroduction and pitfalls of Java's new concurrency model
38mStructuredTaskScope And ScopedValue - Get The Most Out of Virtual Threads
