Asynchronous Programming in Java using Virtual Threads
summary
Java now runs blocking IO without blocking OS threads by using virtual threads mount and unmount as continuations ride courier threads, so a blocked task unmounts its virtual thread and real threads serve others. Existing code needs one line change to use a virtual-thread-per-task executor, yielding far fewer threads, higher throughput and better availability for IO workloads. Kotlin coroutines use suspend fun and compiler continuations, Java hides that indirection in the JVM. Avoid virtual threads for CPU bound work.
AI-written summary · about
chapters (8)
- 0:00Introduction to Java evolution
- 2:53Shift to asynchronous programming
- 13:10Non-blocking vs blocking threads
- 23:08Virtual threads concept
- 36:41Virtual threads in practice
- 51:54Async programming challenges
- 58:03Architectural benefits of virtual threads
- 1:00:10Summary and Q&A
related talks
44mAsync Showdown: Java Virtual Threads vs. Kotlin Coroutines
50mAsynchronous Programming in Java using Virtual Threads
49mEven threads are now virtual:past, present, future of concurrency in Java.
50mAsync Showdown: Java Virtual Threads vs. Kotlin Coroutines
52mContinuations: The magic behind virtual threads in Java
36mJava vs. Kotlin: The Ultimate Showdown of Virtual Threads & Coroutines
38mIntroduction and pitfalls of Java's new concurrency model
38mIntroduction and pitfalls of Java's new concurrency model
