~/talk

C++20 coroutines as an API principle

Talkat Meeting C++ 2021 · 2021-11-10..11-12· [rust]
name:Marc Mutz
links:none on file
slides:none on file

Claim: C++20 coroutines let APIs expose lazy, non-owning sequences instead of owning containers so functions interoperate across ABI boundaries while avoiding eager allocation. Evidence: generator return types, ABI and out-of-line codegen analysis, virtual coroutines, and Qt examples that reveal initial_suspend lifetime traps, heap coroutine frames and reentrancy hazards. Solutions shown include pinning rvalues via custom promise or overloads, allocator-aware promise allocation and the experimental caller-supplied storage idiom. Result: coroutines reduce wasted work but require careful promise design and lifetime discipline.

AI-written summary · about

  1. 0:00Start
  2. 1:36Introduction
  3. 9:24Owning Containers and Apis Restrict the Implementation
  4. 14:39How To Fix the Lifetime Issue
  5. 22:41Yielding Coroutine
  6. 23:51Limitations of Coroutines
  7. 28:02Custom Promise Type
  8. 30:14Re-Entrance
  9. 30:26Multi-Threading
  10. 32:18Keep Resources in Right Objects
  11. 33:06Coroutine Frame Allocation
  12. 44:39Signal Slot Connections
~/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.