4 ms·
> From a practical perspective, that must in turn be backed by a multithreaded event loop to be useful Multithreaded? Nope. You can do C++ coroutines just fine
by inetknght 7mo ago
> From a practical perspective, that must in turn be backed by a multithreaded event loop to be useful
Multithreaded? Nope. You can do C++ coroutines just fine in a single-threaded context.
Event loop? Only if you're wanting to do IO in your coroutines and not block other coroutines while waiting for that IO to finish.
> most people end up using coroutines with something like boost::asio
Sure. But you don't have to. Asio is available without the kitchen sink: https://think-async.com/Asio/ https://think-async.com/Asio/
Coroutines are actually really approachable. You don't need boost::asio, but it certainly makes it a lot easier.
I recommend watching Daniela Engert's 2022 presentation, Contemporary C++ in Action: https://www.youtube.com/watch?v=yUIFdL3D0Vk https://www.youtube.com/watch?v=yUIFdL3D0Vk
- Davidbrcz 7mo agoI use asio at work for coroutine. It's one of the most opaque library I've ever used. The doc is awful and impenetrable. The most helpful resource about it is a guy on stackoverflow (sehe). No idea how to get help once SO will have closed
- astrange 7mo agoAsk Claude Code to write a manual for it.