Get The Most Out of Virtual Threads in Java 25 -A Deep Dive into the Latest Achievements of Virtual
summary
Demo builds a Spring Boot REST app that switches Tomcat to virtual threads on Java 25 and shows concrete wins: a microbenchmark goes from 10s to 1s because synchronized used to pin virtual threads to workers; a 1,000-concurrent JMeter run drops per-request latency to the 1s sleep bound. Code uses StructuredTaskScope with a custom Joiner implementation to aggregate three parallel info calls (one throws) and returns the best result, and it replaces ThreadLocal with ScopedValues so context flows across virtual threads.
AI-written summary · about
chapters (11)
- 0:00Virtual threads intro
- 2:10Normal threads inefficiency
- 5:00How virtual threads work
- 6:43Java 25 performance gains
- 7:48Real app with virtual threads
- 11:59Concurrency without reactive
- 16:38Structured task scopes
- 21:51Reusable joiner for concurrency
- 31:04Scoped values vs thread-local
- 39:52Summary and future
- 40:14Q&A
related talks
44mGet The Most Out of Virtual Threads in Java 25: A Deep Dive
46mJava 21: The Revolution of Virtual Threads - A Deep Dive
51mJava 21: The revolution of virtual threads
01h 03mBeyond Virtual Threads: Structured Concurrency
46mJava 21: The revolution of virtual threads - A Deep dive
44mStructuredTaskScope And ScopedValue - Get The Most Out of Virtual Threads
47mVirtual Threads, Structured Concurrency & Scoped Values: Putting it All Together
44mStructuredTaskScope And ScopedValue - Get The Most Out of Virtual Threads
