You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Initial version of the async_generator has been added in f7bfad1
It uses an atomic integer to manage the state of the generator to handle potential races between consumer and producer coroutines and so has a cost of at least one atomic compare-exchange operation per item of the sequence.
In theory, if the compilers could guarantee tail-calls to await_suspend() and coroutine_handle::resume() then we could eliminate the need for this atomic integer. However, for the time-being the atomic integer is is needed to avoid blowing the stack by a potentially unbounded mutual recursion of producer/consumer coroutines.
Add a coroutine type that allows both co_yield and co_await.
The text was updated successfully, but these errors were encountered: