Articles & Books

C++ coroutines: Getting rid of our reference count--Raymond Chen

The series continue.

C++ coroutines: Getting rid of our reference count

by Raymond Chen

From the article:

In an earlier installment, we simplified our promise_ptr type, and one of the consequences of this is that there are no remaining caller of increment_ref. This means that we don’t need a reference count at all and can rely on the state changes to tell us when to destroy the promise: When the awaiter has obtained the result or, or when the coroutine completes and discovers that the awaiter has abandoned its effort to obtain the result...

C++ coroutines: The lifetime of objects involved in the coroutine function--Raymond Chen

The series continue.

C++ coroutines: The lifetime of objects involved in the coroutine function

by Raymond Chen

From the article:

We finally hooked up the last missing piece of our coroutine promise implementation. Before we can look at the tradeoffs we’ve made, let’s step back and follow the lifetime of the various objects involved in the coroutine function.