Introduction and pitfalls of Java's new concurrency model
summary
Java 20/21 virtual threads run as heap‑allocated stacks so creating 100,000 virtual threads in ~225 MB is feasible; demo shows 10,000 sleeping VT tasks start instantly via Executors.newVirtualThreadPerTask. Virtual threads execute on platform carrier threads and are unmounted on blocking calls, but remain pinned by synchronized/native/JNI/file I/O, losing benefits. Structured concurrency (StructuredTaskScope) provides shutdown policies (on success/failure) and examples: fork two tasks, join first result or cancel all on any exception.
AI-written summary · about
chapters (6)
- 0:00Start
- 0:36Outline
- 3:40One thread for each task
- 6:32Virtual threads
- 17:00How does it work
- 21:33Structured concurrency
related talks
38mIntroduction and pitfalls of Java's new concurrency model
41mIntroduction and pitfalls of Java's new concurrency model
51mIntroduction and Pitfalls of Java's New Concurrency Model
45mIntroduction and pitfalls of virtual threads
43mVirtual Threads: Taming the Wild Multithreading Beast
34mIntroduction and pitfalls of Java's new concurrency model
53mVirtual Threads: Ushering in a New Era of Concurrency
37mMultiprocessing evolution & virtual threads in Java
