Java Virtual Threads
summary
Project Loom adds virtual threads — user‑mode, lightweight Java threads that map onto carrier sets and an internal scheduler so a single process can run thousands or millions of concurrent tasks. Microbenchmarks show much lower overhead on 1,000 do‑nothing tasks and clear IO gains versus platform threads, while CPU‑bound work shows parity. A simple thread‑per‑request web server reaches throughput comparable to tuned async frameworks. Guidance: avoid pooling virtual threads, use semaphores to limit concurrency, avoid thread‑locals (experiments show 20% slowdown), and prefer java.util.concurrent locks until synchronized monitors become Loom‑friendly; structured concurrency and scoped values are preview features.
AI-written summary · about
chapters (13)
- 0:00Introduction to Project Loom
- 2:06The problem with Java threads
- 4:43Understanding virtual threads
- 8:03Virtual threads performance
- 10:27IO and CPU benchmarks
- 12:07Real world applications
- 13:47Helidon Nima framework
- 15:28Little's Law and utilization
- 19:14Migration and best practices
- 21:33Thread locals and scoped values
- 24:07Understanding thread pinning
- 27:23Future Loom improvements
- 28:34Structured concurrency
related talks
53mVirtual Threads: Ushering in a New Era of Concurrency
52mJava Virtual Threads
51mWhat's Looming in Java The Why and What of Project Loom
49mPrepare for what “Loom”s ahead.
57mUnveiling the Magical Power of Java Virtual Threads
47mThe Challenges of Introducing Virtual Threads to the Java Platform - Project Loom
01h 00mLoom Virtual Threads in the JDK 20
39mProject Loom: Modern Scalable Concurrency for the Java Platform
