~/talk

Continuations: The magic behind virtual threads in Java

Talkat Devoxx Belgium 2024 · 2024-10-07..10-11· [java]
slides:none on file

Explains how Java 21 virtual threads use continuations to pause and resume execution, showing the actual API calls Continuation.doYield/doRun and constructing continuations with new Continuation(scope, runnable); builds a toy scheduler using ExecutorService and ScopedValues, simulates blocking with a Timer, and implements a simple VirtualThread class. Demonstrates performance: 2,000 virtual threads on 10 platform threads finish quickly while a plain platform-thread version runs far longer. Notes continuations remain internal to the JDK for now.

AI-written summary · about

  1. 0:00Introduction to talk
  2. 1:51Virtual threads overview
  3. 5:03Creating virtual threads
  4. 8:04Understanding continuations
  5. 10:14Continuation API demo
  6. 15:29Stack management mechanics
  7. 18:02Generators with continuations
  8. 19:40Implementing the generator
  9. 25:42Building virtual threads
  10. 44:22Summary and Q&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.