Preparing web applications for Loom
summary
Project Loom’s virtual threads run on Java 21 and plug into Apache Tomcat (connector option useVirtualThreads=true), offering near-transparent scalability gains for blocking web apps: experiments show about 50 microseconds per request lower contention overhead and higher throughput once concurrent requests exceed core count. Workarounds include replacing synchronized blocks with ReentrantLock to avoid pinning, rethinking thread‑local caching and exploring adaptive caching strategies; Tomcat plans support in June releases and recommends testing on real apps to quantify benefits.
AI-written summary · about
chapters (11)
- 0:00Project Loom introduction
- 1:28Servlet scalability history
- 7:07Virtual threads explained
- 10:15Virtual threads in Tomcat gotchas
- 13:26Virtual threads impact on apps
- 16:58Performance testing setup
- 19:30Throughput: virtual vs platform threads
- 26:34Virtual threads ease of use
- 29:42Switching to virtual threads
- 31:47Tomcat virtual thread integration
- 34:33Future improvements
related talks
40mPreparing Spring Web Applications for Loom
41mServices Reloaded Increased Throughput with Project Loom Virtual Threads
31mJava Virtual Threads
38mJava Project Loom: Why Should I Care?
49mPrepare for what “Loom”s ahead.
51mWhat's Looming in Java The Why and What of Project Loom
39mProject Loom: Modern Scalable Concurrency for the Java Platform
47mConcurrent and Asynchronous Programming: Loom in Java 20 and 21
