~/talk

Introduction and pitfalls of Java's new concurrency mode

Talkat DevWorld 2024 · 2024-02-29..03-01· [web-performance]
slides:none on file

Java 21 adds virtual threads and structured concurrency and claims a cheap thread‑per‑task model: startVirtualThread or startVirtualThread and Executors.newVirtualThreadPerTaskExecutor spawn many lightweight threads (the demo reaches 100,000 threads), using carrier threads with mounting/unmounting to copy stacks to the heap. Pitfalls include methods that cause pinning (synchronized/native calls), thread‑locals leaking in pools, legacy libraries that pin, worse performance for long CPU‑bound tasks, and the need to measure rather than assume wins.

AI-written summary · about

  1. 0:00Java’s new concurrency model
  2. 2:44Platform threads pitfalls
  3. 5:36Virtual threads improve concurrency
  4. 10:16Virtual threads lifecycle
  5. 14:35Pinning virtual threads
  6. 15:40Virtual threads pitfalls
  7. 18:31Structured concurrency
  8. 22:42Summary
~/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.