Loading…
Attending this event?
Thursday September 19, 2024 09:00 - 10:00 MDT
One of the most powerful applications of coroutines is in the context of asynchronous operations, where their use allows for significant simplifactions of application code. Unfortunately, building an asynchronous library interface to enable such benefits for applications is not exactly straightforward in C++.

In this talk we will explore the essentials of managing asynchronous control flow with coroutines. We will discover how to reconstruct the call stack of nested asynchronous calls and thus bridge a significant gap between C++'s stackless coroutines and the stackful coroutines from other languages. We will learn how to build a mechanism similar to the async/await from languages like Python or Javascript for our own libraries. And we will explore how we can perform arbitrary manipulations of the call stack in such an environment to unleash the full power of C++'s coroutine mechanism.

At the end of this talk we will have a proper understanding of how the Task<> type found in many coroutine libraries works and how it can be used to manage asynchronous operations. This will serve as an important building block for understanding more advanced mechanisms, like the sender/receiver mechanism proposed for C++26.

This talk assumes basic familiarity with the components of the C++ coroutines language feature: promises, awaitables, coroutine handles, and passing data in and out of coroutines.

This is the second part in an ongoing series of talks about C++20 coroutines.
Speakers
avatar for Andreas Weis

Andreas Weis

Andreas Weis has been writing C++ code in many different domains, from real-time graphics, to distributed applications, to embedded systems. As a library writer by nature, he enjoys writing portable code and exposing complex functionalities through simple, richly-typed interfaces... Read More →
Thursday September 19, 2024 09:00 - 10:00 MDT
Track 4

Log in to save this to your schedule, view media, leave feedback and see who's attending!

Share Modal

Share this link via

Or copy link