Putting Coroutines to Work with the Windows Runtime
summary
Shows how C++ coroutines are adapted to Windows Runtime by making the four WinRT async interfaces awaitable, using await adapters and await_transform to expose get_progress_token and cancellation, and by coalescing promise + async object into one allocation so the runtime avoids extra heap work. Demonstrates thread-pool primitives like resume_background and resume_after for IO, timers and waits, and reports a microbenchmark (1,000,000 runs) showing about 40x faster than std::future; the implementation is practical and interoperable with the Windows thread pool and C++/WinRT headers.
AI-written summary · about
chapters (12)
- 0:00Introduction and setup
- 1:28Async operations today
- 3:54C++/WinRT async basics
- 7:02Windows Runtime async interfaces
- 12:22Making async types awaitable
- 16:55Coroutine traits for WinRT async
- 22:53Progress and cancellation in coroutines
- 27:50Thread pool integration
- 33:07Thread context switching
- 36:39Thread pool wait and timer objects
- 42:20Performance benchmarks
- 47:14Resources and closing
related talks
01h 01mUnderstanding C++ Coroutines by Example, Part 1
58m“C++ Coroutines - a negative overhead abstraction"
52mCoroutines: C++ vs Rust
48m“Coroutines: what can't they do?”
01h 16mC++ Feature Coroutines, Beginner Friendly
01h 06mC++ Coroutines from scratch
01h 30mC++ Coroutines and Structured Concurrency in Practice
01h 04m“Nano-coroutines to the Rescue! (Using Coroutines TS, of Course)”
