await 2.0: Stackless Resumable Functions
summary
C++17 proposal claims stackless resumable functions that scale to 100,000,000 concurrent coroutines and expose await and yield as keywords; implementation shows a single coroutine-frame allocation, suspend/resume cost near a function call, and zero-overhead adapters to raw OS async APIs (convertible to void* and reconstitutable). Demos include generators, goroutine-style chains (100M goroutines passing a value with ~30 ns per hop, ~15× slower than an empty call) and 1.6 billion recursive invocations in ~20 KB of space.
AI-written summary · about
chapters (12)
- 0:00Introduction to coroutines
- 0:59Defining coroutine concepts
- 5:55Design goals and mechanics
- 7:52Implementation and syntax
- 13:59Standardization and Q&A
- 18:02Generators and recursion
- 23:57Advanced scalability testing
- 26:15Concurrency and channels
- 29:09Customizing awaitables
- 34:24Advanced library integration
- 38:48Resumable handles and timers
- 45:35Exception-free error handling
related talks
01h 02mC++ Coroutines from scratch
01h 04mDeciphering Coroutines - a visual approach
41m(Don't) use coroutines for this
55mBehavioral Modeling in HW/SW Co-design Using C++ Coroutines
01h 03mFrom Problem to Coroutine: Reducing I/O Latency
55mC++ Concurrency TS 2 Use Cases and Future Direction
25mAsynchrony: Under the Hood
34mStream into the Future
