~/talk

Understanding C++ Coroutines by Example, Part 1

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

Builds a minimal coroutine library from the ground up: a task + promise type, the five mandatory promise functions, get_return_object, initial/final_suspend behavior, and how co_await is lowered to awaitable checks and suspend/resume. Implements a task::operator co_await, a final awaitable that resumes a continuation, and a sync_wait using std::promise/std::future with atomic states to make it thread safe (atomic states: started/attached/finished). Demonstrates an async file read with worker thread, shows why detach can lose results, and recommends Lewis Baker’s cppcoro.

AI-written summary · about

  1. 0:00Start
  2. 8:44Curtain Statement
  3. 11:16Initial Suspend
  4. 12:30Default Constructor
  5. 12:45Promise Pointer
  6. 14:40Get Return Objects
  7. 16:59Return Value
  8. 18:03Unhandled Exception
  9. 20:15Mandatory Member Functions
  10. 23:58Recap
  11. 27:16Operator Function Call
  12. 36:00Catch Clause
  13. 42:40Suspend
  14. 55:11Implementation
~/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.