~/talk

Implementing a C++ Coroutine Task from Scratch

Talkat ACCU 2023 · 2023-04-19..04-22· [c-and-cpp, concurrency]
links:none on file
slides:none on file

Live codes a working C++20 coroutine-based Task: implements the required promise type methods (initial_suspend, final_suspend, get_return_object, unhandled_exception), builds a Task wrapper with start(), handles nested co_await by storing a continuation and using synchronous transfer (returning coroutine_handle), and mocks an IO context to show async read completions. Debugs crashes and a memory leak by using a unique_ptr with a custom deleter that destroys the coroutine frame. Compiles on mainstream compilers and the prototype largely works after fixes.

AI-written summary · about

  1. 0:00Introduction
  2. 0:10Coroutines
  3. 1:53Why Coroutines
  4. 4:35Key Coroutines
  5. 5:20Coroutine Expression
  6. 9:42Veda Tab
  7. 10:14Quarantine Frame
  8. 16:04Minimum 4 Functions
  9. 16:23Demo
  10. 17:04Hint
  11. 18:53Hello World
  12. 20:32Implementing a Task
  13. 50:49Evasion test
~/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.