Java 21: The Revolution of Virtual Threads - A Deep Dive
summary
Live code shows Java 21 virtual threads replacing reactive rewrites: a blocking Spring Boot REST that OOMs when spawning 1 million platform threads runs fine with virtual threads, JMeter tests with 1,000 concurrent users hold ~1s latency and the JVM only uses ~45 OS worker threads. Demo uses Spring Boot (3.2 RC with spring.threads.virtual.enabled=true), Thread.sleep-simulated I/O, and structured task scopes to run per-speaker HTTP calls in parallel, cutting 10× serial latency to ~1.5s. Notes pinning in synchronized/native calls and preview status for scopes.
AI-written summary · about
chapters (14)
- 0:00Introduction and speaker intro
- 1:07Building blocks of the talk
- 7:55Platform threads limitations
- 10:26Reactive programming overview
- 17:52Problems with reactive approach
- 19:18Project Loom and virtual threads
- 26:40Enabling virtual threads in Spring Boot
- 29:52Virtual threads vs blocking performance
- 30:54Structured task scopes explained
- 34:47Simplifying structured task scopes
- 39:49Thread locals and synchronized blocks
- 42:39Virtual threads restrictions
- 43:01Conclusion and future outlook
- 44:27Q&A session
related talks
46mJava 21: The revolution of virtual threads - A Deep dive
51mJava 21: The revolution of virtual threads
50mGet The Most Out of Virtual Threads in Java 25 -A Deep Dive into the Latest Achievements of Virtual
43mVirtual Threads: Taming the Wild Multithreading Beast
44mGet The Most Out of Virtual Threads in Java 25: A Deep Dive
38mJava Project Loom: Why Should I Care?
47mMore Action, More Overview – From 4k to 1M Threads
37mMultiprocessing evolution & virtual threads in Java
