~/talk

Coroutines: C++ vs Rust

Talkat C++ on Sea 2022 · 2022-07-05..07-07· [c-and-cpp, concurrency]
links:none on file
slides:none on file

Compares concrete designs: C++ coroutines let a user-provided promise/awaitable resume from the bottom up, own the state machine (heap by default, optimized to stack), and implement continuations to transfer execution between threads; Rust makes coroutines into typed futures that must be pinned, uses a waker and executor that polls futures top down, and keeps state as a compile-time type. Demos include a guard patrol, timer and socket read, a segmentation-fault loop fixed with tail-call-style resumptions, and a working thread-pool scheduling example.

AI-written summary · about

  1. 0:00Intro
  2. 0:54Motivation: Guard Patrol
  3. 2:09Guard Patrol: State machine
  4. 4:01Terminology
  5. 6:30Defining a coroutine
  6. 8:51Implementing task
  7. 12:01Guard Patrol: C++ coroutine
  8. 18:25Guard Patrol: Rust coroutine
  9. 28:19Execute continuation in promise
  10. 35:38Compiler transformation
  11. 36:47Using a timer
  12. 37:18Implementing a timer
  13. 43:13Rust: Sockets
~/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.