~/talk

Kotlin Coroutines Reloaded

Talkat JVM Language Summit 2017 · 2017-07-31..08-02· [java, concurrency]
slides:none on file

Kotlin rewrites coroutines to avoid rare synchronous callback recursion bugs by changing the suspend protocol: a call either returns the result or the COROUTINE_SUSPENDED token, implemented via a hidden CPS transformation and a compiler intrinsic suspendCoroutine plus tail-call forwarding. Continuations gain a CoroutineContext so dispatch and thread-affinity are pluggable; libraries provide channels, mutex, actors, runBlocking and Java Future adapters. Trade-offs: no JVM hacks for thread‑locals, imperfect stack traces on exceptions, and the feature remains experimental and opt‑in.

AI-written summary · about

  1. 0:00Intro
  2. 1:44Async the Kotlin way (prototype)
  3. 2:37Suspending functions: use
  4. 2:53Suspending functions: declare (prototype)
  5. 3:27Suspending functions: implement (prototype)
  6. 4:41A problematic example
  7. 7:04stack unwind convention
  8. 7:14A solution (0)
  9. 8:55Call/declaration fidelity
  10. 12:15Tail suspension
  11. 13:12Abstraction
  12. 14:58Recap steps to solution
  13. 15:43The final touch: await extension
  14. 16:54Coroutine builders (prototype)
  15. 20:35Arbitrary suspending calls
  16. 23:16Stackless vs Stackful coroutines
  17. 27:04The problem with async
  18. 29:59Composability: evolved
  19. 31:35asyncul (prototype)
  20. 33:09The actual Continuation interface
  21. 35:59Thread confinement vs coroutines
  22. 38:20Stack traces in exceptions
  23. 40:54Library evolution: already there
  24. 43:23Library evolution: WIP
  25. 45:05A closing note on terminology
  26. 45:45Experimental status of coroutines
~/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.