More Action, More Overview – From 4k to 1M Threads
summary
Claims that Java 21 virtual threads let a process spawn ~1,000,000 threads (1KB each vs 1MB for platform threads), creating them in microseconds and running I/O-bound work massively parallel; demos convert an executor to a virtual-thread-per-task executor and show a million-blocked tasks finishing far faster. Shows a rule engine that executes 100,000 business rules in parallel, uses scope values (Java 25) instead of ThreadLocal, applies structured concurrency for error handling, and provides OpenRewrite recipes plus a GitHub GIST for reproduction.
AI-written summary · about
chapters (15)
- 0:00Introduction
- 1:50Traditional thread limits problem
- 3:16Thread management basics
- 4:42Demo introduction
- 8:37Virtual threads advantages
- 14:09When to use virtual threads
- 16:19Scope values for thread-safe context
- 23:01Structured concurrency
- 29:04Error handling improvements
- 29:25Live demos: 1M threads
- 34:02Scope values API examples
- 38:40Combining virtual threads benefits
- 39:22Migration strategies
- 43:04Best practices
- 46:34Q&A
related talks
46mJava 21: The revolution of virtual threads - A Deep dive
46mJava 21: The Revolution of Virtual Threads - A Deep Dive
45mIntroduction and pitfalls of virtual threads
51mJava 21: The revolution of virtual threads
43mVirtual Threads: Taming the Wild Multithreading Beast
51mIntroduction and Pitfalls of Java's New Concurrency Model
41mIntroduction and pitfalls of Java's new concurrency model
53mVirtual Threads: Ushering in a New Era of Concurrency
