Zero-Allocation & No Type Erasure Futures

By Vittorio Romeo

The most popular implementations of futures, including std::future, use dynamic allocation and type erasure in order to allow composition of futures into fork/join asynchronous computation graphs. While this overhead is unavoidable when the control flow of the asynchronous graph depends on run-time conditions, it is unnecessary when the "shape" of the computation graph is known at compile-time.

  • Is it possible to implement composable futures without dynamic allocation and type erasure?

  • Is it worth it?

After a brief overview of the upcoming std::experimental::future additions focused on composability, this talk answers these questions showing the train of thought behind the design and implementation of an experimental future library, step-by-step. Running time, compilation time, and generated assembly benchmarks/comparisons will be provided and analyzed.

The code covered in the talk will make use of C++17 language and library features, that will be explained throughout the presentation. The intended audience for the talk should be familiar with most C++11/14 language features and with std::future (or boost::future). Knowledge of C++17 features is helpful but not required.





Your Privacy

By clicking "Accept Non-Essential Cookies" you agree ACCU can store non-essential cookies on your device and disclose information in accordance with our Privacy Policy and Cookie Policy.

Current Setting: Non-Essential Cookies REJECTED


By clicking "Include Third Party Content" you agree ACCU can forward your IP address to third-party sites (such as YouTube) to enhance the information presented on this site, and that third-party sites may store cookies on your device.

Current Setting: Third Party Content EXCLUDED



Settings can be changed at any time from the Cookie Policy page.