~/talk

StructuredTaskScope And ScopedValue - Get The Most Out of Virtual Threads

Talkat Porto Tech Hub Conference 2025 · on Tuesday, 2025-10-07· [java]
slides:none on file

A live‑coded Spring Boot app uses Java 21 virtual threads plus preview features from Java 25 to replace blocking REST calls with concurrent subtasks, showing JMeter with 1,000 concurrent users drop worst‑case responses from ~4s to ~1s (sleeped endpoints: 1s and 3×500ms). A custom StructuredTaskScope joiner (info joiner) aggregates only successful results and preserves exceptions; ScopedValue replaces ThreadLocal so per‑request context survives child virtual threads. The example compiles, runs, and demonstrates concrete performance and correctness gains.

AI-written summary · about

  1. 0:00Introduction
  2. 1:49Virtual threads overview
  3. 11:21Why virtual threads aren't enough
  4. 17:01StructuredTaskScope basics
  5. 21:58Custom joiner implementation
  6. 28:40Benefits of structured task scopes
  7. 32:33Thread locals vs scope values
  8. 42:30Recap and summary
  9. 43:10Q&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.