The Concurrency Triangle
summary
Claim: the same continuation+scheduler+thread‑pool+yield pattern appears at three levels: library, compiler, runtime. Scala implements multi-shot continuations as heap‑allocated IO/fibers that let you run millions of fibers and batch thousands of steps before yielding; Kotlin turns suspending functions into compiler‑generated state machines with a Continuation/label pair; Java implements virtual threads by copying stack frames to the heap so blocking calls like Thread.sleep become nonblocking. Trade‑off is visibility and control (Scala) versus convenience (Kotlin) versus transparent runtime (Java).
AI-written summary · about
chapters (14)
- 0:00Concurrency triangle intro
- 1:48Concurrency vs parallelism
- 3:58OS thread problem
- 5:45Four pillars of solutions
- 6:50Scala fibers and continuations
- 13:13Scala scheduler and pools
- 15:41Scala concurrency summary
- 16:03Kotlin continuations
- 21:40Kotlin dispatchers
- 23:06Java virtual threads
- 27:21Virtual threads blocking
- 29:26Trade-offs Scala Kotlin Java
- 30:09Continuations one-shot vs multi
- 31:00Conclusion
related talks
46mContinuations: The magic behind virtual threads in Java
59mContinuations and Fibers: The New Frontier for Java
43mCoroutines for Java Developers
44mConcurrency in Scala and on the JVM
36mHow Do People Handle Concurrency?
46mTour d’horizon de la gestion de la concurrence dans différents langages
40mEverything Everywhere All at Once
40mConcurrency made easy with Kotlin Coroutines
