~/talk

Coroutines and Go

Talkat GopherCon AU 2023 · 2023-11-08..11-10· [concurrency, go]
slides:none on file

Shows a concrete implementation of coroutines in Go using goroutines and channels as the transport, exposing a cororo package with resume/yield/cancel semantics, panic propagation and a cancel handshake so callers do not deadlock. Claims no added parallelism (only one coroutine runs at a time). Measurements: channel-based switches cost about 190 ns per switch, compiler fusion cuts that ~38% to ~118 ns, and a direct coroutine switch drops to 20 ns. The design works and handles panics and cancellation.

AI-written summary · about

  1. 0:00Introduction to coroutines
  2. 1:34Defining subroutines
  3. 4:13Binary tree comparison example
  4. 6:05History of coroutines
  5. 9:21Coroutines in modern languages
  6. 12:38Classifying coroutines
  7. 16:44Coroutines in Go
  8. 18:57Coroutines vs threads
  9. 20:26Implementing coroutines in Go
  10. 24:02Robust coroutine features
  11. 27:56Runtime optimizations
  12. 29:15Conclusion and references
~/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.