Unveiling the Magical Power of Java Virtual Threads
summary
Project Loom adds user‑space virtual threads to the JVM (goal: millions of threads) implemented via continuations and a ForkJoinPool scheduler with carrier threads that mount/unmount thread state; synchronized blocks and native calls cause pinning with synchronized/native calls (jdk 24 uplifts synchronization to avoid pinning). Experiments on Open Liberty using an Open Liberty online banking simulator (2‑CPU) show faster ramp‑up but throughput limited (~50% in some tests) due largely to the scheduler and OS interactions. Structured concurrency and scoped values replace thread‑locals for bounded, safer context propagation.
AI-written summary · about
chapters (10)
- 0:00Introduction and speaker background
- 2:37Legacy Java threading model
- 8:43Project Loom and virtual threads
- 16:39Virtual threads internals
- 27:15Virtual thread pinning issues
- 32:39Best practices for virtual threads
- 34:48Virtual threads performance analysis
- 45:34Structured concurrency overview
- 48:54Scoped values explained
- 54:20Q&A session
related talks
47mThe Challenges of Introducing Virtual Threads to the Java Platform - Project Loom
50mProject Loom: Helping Write Concurrent Applications on the Java Platform
31mJava Virtual Threads
51mWhat's Looming in Java The Why and What of Project Loom
01h 13mProject loom: Modern scalable concurrency for the Java platform
39mProject Loom: Modern Scalable Concurrency for the Java Platform
47mConcurrent and Asynchronous Programming: Loom in Java 20 and 21
49mPrepare for what “Loom”s ahead.
