~/talk

Virtual Threads: Ushering in a New Era of Concurrency

Talkat JCON WORLD ONLINE 2023 · on Tuesday, 2023-11-21· at 16:00· Live-Stream 3, Online - Remote· [java]
slides:none on file

Project Loom adds lightweight virtual threads in JDK 21 (JEPs 425, 436, 444) that let Java run millions of concurrent tasks cheaply: demos create 10 million virtual threads and replace pools by Executors.newVirtualThreadPerTaskExecutor or Thread.ofVirtual().start, cutting a 10k-task sleep-based benchmark to ~63 ms (claimed ~99% speedup). Virtual threads sit on a small set of platform carriers so CPU-bound work still uses platform threads; beware pinning by synchronized/native calls and use ReentrantLock or JFR to diagnose.

AI-written summary · about

  1. 0:00Introduction to virtual threads
  2. 10:48Limitations of traditional threads
  3. 20:07Creating and using virtual threads
  4. 27:59How virtual threads work under the hood
  5. 33:50Pitfalls and best practices with virtual threads
  6. 40:23When to use virtual vs platform threads
  7. 47:23Virtual threads vs reactive programming
  8. 51:42Closing and resources
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.