Elegant Asynchronous Code
summary
Claim: Boost.Fiber lets async I/O be written like blocking, layered C++ code while avoiding many OS threads. Uses Boost.Fiber plus adapters to boost::asio callbacks that convert into std::promise/std::future, package_task, and unbounded/bounded channels; demonstrates read adapters, a wait_any/wait_all pattern using detached fibers and channels, and custom schedulers. Shows cooperative yielding via yield to integrate with event loops, notes thread sanitizer slows 5–15× and boosts memory 5–10×. Fibers work and are in Boost 1.62.
AI-written summary · about
chapters (19)
- 0:00Intro
- 0:37Program Organization - How do you design a nontrivial program?
- 3:33Threads
- 8:52The Cost of Locking
- 12:10Tooling?
- 14:57Async hole
- 15:53Async lifelines
- 19:48Boost.Fiber
- 20:38What are Fibers?
- 23:24What about stackless?
- 27:50Stacks for the win
- 28:56A passing glance at the Fiber API
- 30:50Fibers and Asynchronous Callbacks
- 33:03Fibers and Nonblocking 10
- 41:35wait all()
- 43:42Integrating with an Event Loop
- 44:55Integrating with Another Framework
- 46:22Customizing the Fiber Scheduler
- 49:14Performance
related talks
42mHow to write synchronization mechanisms for Fiber
40mFiber in the 10th year
01h 00mHow do Fibers Work? A Peek Under the Hood
01h 05mImplementing async with coroutines and fibers - project Loom in C#
01h 02mAsynchronous Programming in Modern C++
58mThe Networking TS in Practice: Testable, Composable Asynchronous I/O in C++
01h 31mHistory of Time: Asynchronous C++
20mIt's Critical: Concurrent programming as a sane programming model
