Java 21: The revolution of virtual threads
summary
Live-code builds a Spring Boot app and migrates it from blocking to reactive to virtual threads, using JMeter 1,000 concurrent users to show blocking with Tomcat’s 200-thread pool causing responses to climb past 3.5s, then switching to virtual threads to run millions of logical threads while OS threads stay around ~50. Adds structured task scope to parallelize 10 speaker→talk calls and drops a 6s blocking request to about 1.5s, notes Java 21/24/25 preview differences and thread-local/scoped-value caveats.
AI-written summary · about
chapters (8)
- 0:00Introduction
- 1:46Blocking code with REST
- 9:11Limitations of platform threads
- 13:04Reactive programming drawbacks
- 19:51Virtual threads introduction
- 26:51Structured task scopes
- 35:22Performance comparison
- 38:32Conclusion and future
related talks
46mJava 21: The revolution of virtual threads - A Deep dive
46mJava 21: The Revolution of Virtual Threads - A Deep Dive
50mGet The Most Out of Virtual Threads in Java 25 -A Deep Dive into the Latest Achievements of Virtual
44mGet The Most Out of Virtual Threads in Java 25: A Deep Dive
38mJava Project Loom: Why Should I Care?
39mUnlocking Data-Intensive Applications with Virtual Threads
47mMore Action, More Overview – From 4k to 1M Threads
57mJDK 19 Virtual Threads: Skip Reactive, Boost Throughput
