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
0
u/trailing_zero_count async enthusiast | TooManyCooks author Feb 22 '26
Sure, if you write this, it works:
But nobody wants to write code like that. If you make the below seemingly reasonable refactor to reduce verbosity, it breaks. Having safety be enforced by convention only is not OK.