Multiprocessing evolution & virtual threads in Java
summary
Virtual threads arrive as JDK 21 GA offering M:N mapping of virtual-to-platform threads, tiny allocation (stacks on the GC heap) and cheap creation so you can run millions of tasks. Scheduler mounts/unmounts virtual threads to platform threads; pinning (e.g. synchronized) forces platform threads so prefer java.util.concurrent locks. Use the newVirtualThreadPerTaskExecutor and you get real gains: a demo runs 1,000 simulated network sleeps in 1000 requests: 10s vs 1s. Spring Boot 3.2 supports them via a simple flag; Helidon already adopts them.
AI-written summary · about
chapters (16)
- 0:00Introduction
- 1:07Virtual threads journey
- 2:14Concurrency vs parallelism
- 3:58Thread challenges deep dive
- 8:12Thread pool limitations
- 9:16Async I/O and event loops
- 13:28Async I/O problems and fixes
- 16:15Reactive programming issues
- 18:44Virtual threads in Java
- 22:37Virtual threads for scalability
- 24:24Memory impact and internals
- 26:31Mounting unmounting pinning
- 29:19Profiling virtual threads
- 30:01Thread approaches demo
- 31:49Virtual threads in Spring Boot
- 32:31Q&A
related talks
43mVirtual Threads: Taming the Wild Multithreading Beast
38mIntroduction and pitfalls of Java's new concurrency model
45mIntroduction and pitfalls of virtual threads
53mVirtual Threads: Ushering in a New Era of Concurrency
38mIntroduction and pitfalls of Java's new concurrency model
46mJava 21: The Revolution of Virtual Threads - A Deep Dive
41mIntroduction and pitfalls of Java's new concurrency model
51mIntroduction and Pitfalls of Java's New Concurrency Model
