Channels - An alternative to callbacks and futures
summary
Channels implemented as a C++ library using the Coroutines TS plus Boost.Fiber and Boost.Futures replace one-off futures with a streaming primitive that achieves zero dynamic allocations after setup, interoperates with threads and coroutines, and supports select (when_any) across channels. Microbenchmarks show simple channel sends run in the same ballpark as callbacks and roughly 6x faster than futures; the implemented select is about twice as slow as raw callbacks but ~50% faster than Go’s select. An ordered-parallel processor using pooled buffers works lock‑free and without allocations while running.
AI-written summary · about
chapters (22)
- 0:00Introduction and background
- 2:06Asynchronous programming models
- 5:05Limitations of callbacks and futures
- 7:18Performance comparison
- 8:41Go channels and Boost.Fiber
- 10:07Designing C++ channels
- 13:40Coroutines and channels
- 18:14Channel implementation details
- 21:09Adding an executor
- 22:58Performance results
- 23:18Channel select and when-any
- 25:46Why not futures for streams
- 26:31Select implementation
- 30:06Select range and selection
- 33:24Channel select performance
- 34:27Additional channel features
- 34:49Example: ordered output with channels
- 36:57Processor and reader implementation
- 38:23Writer and reordering logic
- 41:16Thread interoperability
- 42:19Summary and future work
- 43:24Q&A
related talks
32mChannels in Rust: The Art of Concurrency
01h 04mcore.async: Concurrency without Callbacks
59mThe Tale of How We Implemented the Channel Algorithm in Kotlin Coroutines
01h 28mThere Is A Better Future
01h 30mC++ Coroutines and Structured Concurrency in Practice
36mConcurrent ML - The One That Got Away
01h 14mHow to Use C++20 Coroutines for Networking
31mCoroutines and Go
