Zero-allocation & no type erasure futures
summary
Claims a composable future system that encodes the entire async graph in C++ types to achieve zero-allocation and no type erasure, implemented with C++17 features (CTAD, deduction guides, fold expressions) and boost.callable_traits. Implements leaf/sequence/all/any nodes, an in-place shared state, and sync_execute with a latch; any lacks automatic cancellation. Benchmarks show about 2x improvement for very short tasks, with a practical crossover near ~1 ms where allocation/type-erasure overhead becomes negligible. Prototype compiles on GCC 7 and Clang 8 and works with the stated lifetime restriction (graph must outlive execution).
AI-written summary · about
chapters (19)
- 0:00Start
- 6:57The Fork / Join Paradigm
- 8:32Type Erasure and Dynamic Allocation
- 12:11Dynamic Allocation
- 13:23Alternative Proposal
- 16:39Recap
- 20:51Leaf Node
- 24:01Seek Sequence
- 30:07Usage Example
- 41:34Return Volley Propagation
- 44:58Boost Callable Traits
- 48:43Final Implementation
- 49:45Sequential Node
- 53:17Synchronous Propagation
- 56:14Compute the in Type and Out Type
- 1:00:42Magic Enumerate Types Function
- 1:24:49Success Path
- 1:27:15Conclusion
- 1:29:10Deferred Execution Policy
related talks
55mBreaking Dependencies: Type Erasure - The Implementation Details
29mConcurrency TS Editor's Report
01h 02mFunctional C++
01h 04mConcurrency in C++20 and Beyond
51mModern techniques for keeping your code dry
01h 39m“Leak-Freedom in C++... By Default.”
01h 02mAsynchronous Programming in Modern C++
56m“The C++ Execution Model”
