~/talk

Introduction and pitfalls of Java's new concurrency model

Talkat Copenhagen Developers Festival 2023 · 2023-08-28..09-01· [java, concurrency]
slides:none on file

Java introduces virtual threads (preview in Java 20, available to try in Java 21) as lightweight JVM‑managed threads that let an application create 10,000 virtual threads on a laptop where platform threads OOM, because stacks live on the heap and resize. New APIs include Thread.startVirtualThread and Executors.newVirtualThreadPerTaskExecutor, and structured concurrency via StructuredTaskScope with policies like shutdownOnSuccess and shutdownOnFailure. Demos show mounting/unmounting on carrier (platform) threads, pinning for synchronized/native I/O, pitfalls for CPU‑bound work and legacy libraries, and a custom scope that cancels remaining searches when a cheap match is found.

AI-written summary · about

  1. 0:00Java's new concurrency model intro
  2. 2:14Current Java concurrency limits
  3. 8:45Virtual threads explained
  4. 12:20Creating virtual threads
  5. 16:43Scaling with virtual threads
  6. 17:26Virtual thread scheduling
  7. 20:17Pitfalls of virtual threads
  8. 22:03Structured concurrency intro
  9. 26:21Using structured concurrency
  10. 31:23Custom concurrency policies
  11. 35:18Virtual threads best practices
  12. 36:20Q&A
~/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.