Asynchronous Programming in Java using Virtual Threads
summary
Demonstrates that Project Loom virtual threads (Java 19 preview / Java 20 work) let the JVM create Thread.startVirtualThread instead of OS threads, turning blocking IO into non-blocking at the OS level; a thread.sleep demo fails around ~10k native threads with “unable to create native threads” but easily hits 20–30k and one million virtual threads; shows kotlin coroutines/continuations bytecode (continuation parameter) and java.nio file line-count IO example; preview feature, not yet for production.
AI-written summary · about
chapters (11)
- 0:00Introduction to talk
- 1:04Parallel vs concurrent
- 3:14Understanding non-blocking
- 5:43Traditional Java threads
- 10:43Problems with multi-threading
- 16:20Subroutines and continuations
- 27:10Introducing virtual threads
- 34:56Non-blocking with virtual threads
- 42:06When to use virtual threads
- 43:33Impact on Java code structure
- 49:34Key benefits of virtual threads
related talks
51mWhat's Looming in Java The Why and What of Project Loom
47mConcurrent and Asynchronous Programming: Loom in Java 20 and 21
49mPrepare for what “Loom”s ahead.
53mVirtual Threads: Ushering in a New Era of Concurrency
52mJava Virtual Threads
47mThe Challenges of Introducing Virtual Threads to the Java Platform - Project Loom
50mProject Loom: Helping Write Concurrent Applications on the Java Platform
51mThe Future of Java: asynchronous programming with Loom
