~/talk

Explaining Different Coroutine Flavours using Scala Native

Talkat Scala Days 2023 Madrid · 2023-09-12..09-14· [scala, concurrency]
links:none on file
slides:none on file

Explains concrete differences between stackless vs stackful coroutines, shows LLVM intrinsics used (eg llvm.coro.begin and coro suspend that returns -1/0/1) and contrasts state-machine/CPS lowering with copying stacks or using dedicated stacks. Demonstrates a Scala Native prototype that uses setjmp/longjmp style context switches for fibers and mentions an existing PR implementing a boundary suspend continuation for Scala Native. Quantifies tradeoffs: stackless is cheapest but requires code transforms, stackful supports arbitrary suspension but incurs copy or per-fiber stack overhead.

AI-written summary · about

  1. 0:00Welcome
  2. 1:14Motivation for coroutines
  3. 2:17Coroutine classification
  4. 3:42Cooperative vs subroutines
  5. 5:07Stackless coroutines
  6. 8:16Continuation passing style
  7. 8:59Stackful coroutines
  8. 10:23Coroutines and async
  9. 11:48Memory execution
  10. 13:34State persistence
  11. 16:48Fibers and stack
  12. 18:56Context switching
  13. 20:25Coroutines in Scala Native
  14. 22:11LLVM lowering phases
  15. 25:24Implementing coroutines
  16. 29:23Stackful with setjmp/longjmp
  17. 33:20Stackful prototype
  18. 35:06Virtual threads prototype
  19. 36:30Call to action
~/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.