Continuations - Under the Covers
summary
Implementation moves continuation frames into heap stack chunks and uses a lazy copy strategy plus return‑barriers so only new frames are memcopied back to the thread stack, avoiding full-stack copies. GC is extended to treat chunks as objects, allow background bitmap building and later compress chunks, cutting continuation storage by >50% (possibly ~70%). Result: virtual-thread context switching costs drop to near pointer-switch speeds, scales to millions of continuations, and integrates with OpenJDK/loom and JEP 444.
AI-written summary · about
chapters (9)
- 0:00Introduction to continuations
- 2:33Continuation API
- 4:58Thread state and blocking
- 7:23Stack management models
- 10:44Lazy frame copying
- 13:35GC challenges
- 16:06Stack chunk implementation
- 22:47Optimized suspension
- 30:11Performance and future goals
related talks
47mConcurrent thread-stack processing in the Z Garbage Collector
46mLoom - Where Are We?
46mContinuations: The magic behind virtual threads in Java
44mLoom: Revolution or Implementation Detail?
05mLightning Talk: Continuations & Filters
52mContinuations: The magic behind virtual threads in Java
59mContinuations and Fibers: The New Frontier for Java
01h 01mProject Loom: Revolution in Concurrency or Obscure Implementation Detail?
