~/talk

Virtual Threads, Structured Concurrency, Extent Locals: When to Use Them & How

Talkat JCON EUROPE 2025 · 2025-05-12..05-15· [java, concurrency]
links:none on file
slides:none on file

Virtual threads run on platform carrier threads so blocking calls become cheap and throughput jumps — a 1,000-sleep request demo finishes in ~1s on virtual threads versus batched ~200-worker platform threads; memory drops (example: ~64MB vs ~1.9GB) but heap GC increases because suspended stacks land on the heap. Use Java Flight Recorder / Java Mission Control / jcmd / JConsole to observe pinning (synchronized pinning affects Java ≤23, fixed in Java 24), rate-limit external calls with semaphores, avoid virtual threads for CPU-bound tasks, and try structured concurrency (Structured Task Scope in Java 25 preview) and scoped values where inheritable context matters.

AI-written summary · about

  1. 0:00Introduction to virtual threads
  2. 3:28Scoped values and concurrency
  3. 8:11Benefits and use cases
  4. 11:35Implementation and demo
  5. 16:25Throughput and performance
  6. 20:31Monitoring and memory impact
  7. 25:35Resource management
  8. 28:49Pinning and blocking behavior
  9. 32:15File I/O considerations
  10. 33:55Virtual threads vs reactive
  11. 36:24Thread locals and conclusion
  12. 43:23Q&A session
~/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.