r/cpp • u/rhidian-12_ Coroutines4Life • Feb 21 '26
Implementing your own asynchronous runtime for C++ coroutines
Hi all! Last time I wrote a blog post about writing your own C++ coroutines. Now, I wanted to highlight how to write your own C++ asynchronous runtime for your coroutines.
https://rhidian-server.com/how-to-create-your-own-asynchronous-runtime-in-c/
Thanks for reading, and let me know if you have any comments!
41
Upvotes
View all comments
Show parent comment
1
u/TheMania Feb 22 '26
And that's all likely fine, as long as the task doesn't outlive (or at least execute) outside of the lambdas lifetime.
Eg provided the lambda is a named variable in the same scope as you await it, there's no problem to be had.