Comment by lukaslalinsky
Comment by lukaslalinsky a day ago
The trouble with I/O multiplexing in a language like C is that the callbacks and state machines get quite complex as you need more functionality. In C++ you can at least do closures, so it's easier to manage. I recently wanted to add networking to my Zig project and decided to do some yak shaving and implemented a fiber runtime with async I/O to avoid the callback complexity. https://github.com/lalinsky/zio
In C++20 you can use asio + coroutines. I find it pretty nice to work with.