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!
42
Upvotes
11
u/38thTimesACharm Feb 21 '26
I'm looking forward to your upcoming post on coroutine memory safety. The blanket statements in many FAQs and style guides -e.g. "don't pass references into coroutines" or "don't use lambda captures with coroutines" - are too vague, and while they might be good advice for large projects, I'd like to know exactly when references might be invalidated in coroutines and why.
3
u/thisismyfavoritename Feb 21 '26
you can still deadlock and have race conditions on a single thread
0
u/[deleted] Feb 21 '26
[deleted] — view deleted comment