Virtual threads - no pain, no gain
summary
Project Loom virtual threads run on a pool of carrier (ForkJoin) threads and make blocking code look synchronous while actually unmounting and remounting work onto OS threads. Experiments use Quarkus and JDK 22 preview, with defaults: platform threads ~7–8k limit, carrier pool default parallelism = CPU cores, hard max = 256, Quarkus limits thread creation to 200. Practical failures include pinning (synchronized or native calls), monopolization (long CPU work blocks a carrier), and costly thread-local copy inflation; detection uses JFR events and stack dumps. Overall Loom works but libraries must be fixed first.
AI-written summary · about
chapters (14)
- 0:00Introduction and speaker intro
- 1:11Traditional threading model explained
- 3:41Reactive programming with event loops
- 7:34Virtual threads introduction
- 12:05Key issues with virtual threads
- 18:28Live coding demo setup
- 22:43Q&A session
- 24:50Creating virtual threads in code
- 30:50Monopolization and career thread scaling
- 35:54Pinning and synchronized blocks
- 41:39Detecting pinning with JFR events
- 42:24Thread locals in virtual threads
- 47:02Future of Project Loom and ecosystem
- 48:26Closing remarks and resources
related talks
31mJava Virtual Threads
47mThe Challenges of Introducing Virtual Threads to the Java Platform - Project Loom
49mPrepare for what “Loom”s ahead.
01h 13mProject loom: Modern scalable concurrency for the Java platform
47mGame of Loom 2: life and dead(lock) of a virtual thread
51mWhat's Looming in Java The Why and What of Project Loom
01h 00mLoom Virtual Threads in the JDK 20
57mUnveiling the Magical Power of Java Virtual Threads
