~/talk

Java 21: The revolution of virtual threads - A Deep dive

Talkat CPH DevFest 2024 · 2024-08-26..08-30· [java, concurrency]
slides:none on file

Shows migrating a Spring Boot app from blocking to reactive to Java 21 virtual threads, using JMeter with 1,000 concurrent users and artificial delays (1,000ms and 500ms). Demonstrates an OOM when creating 1 million platform threads and then running the same load with virtual threads served by ~40 OS worker threads, cutting the blocking endpoint to ~1s and the speaker+talks flow to ~1.5s using structured task scope and a small CollectionTaskScope helper. Notes risks: thread‑local leaks, synchronized/ native calls, and CPU‑bound work.

AI-written summary · about

  1. 0:00Java 21 and virtual threads
  2. 1:50Blocking Spring Boot app
  3. 6:25Platform threads vs blocking I/O
  4. 11:41Reactive with CompletableFuture
  5. 15:13Reactive code complexity
  6. 22:57Project Loom and virtual threads
  7. 24:04How virtual threads work
  8. 26:34Creating and testing virtual threads
  9. 30:17Migrating Spring Boot to virtual threads
  10. 33:07Structured concurrency with virtual threads
  11. 37:25Custom scopes for concurrency
  12. 40:58ThreadLocals pitfalls
  13. 43:28Conclusion and future
~/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.