New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
io_service question #46
Comments
Great questions! I'll give a brief answer here and try to write up something a bit more detailed in a document that's more easily accessible in the project.
For example, we can efficiently allocate memory for per-operation state on the coroutine frame as local variables rather than having to allocate storage for that state separately on the heap.
AFAIK, the Networking TS doesn't yet add async file I/O to the standard so there is still a gap there to be filled. There may also some potential performance improvements with regards to what can be done with executors and scheduling tasks if they can be built using coroutines.
The first is The second is to add a Both kinds of schedulers can also be used for scheduling generalised parallel/concurrent tasks, not only for async I/O completion events. I'm yet not sure where the line should be drawn between cppcoro and the other async I/O projects. However, there don't seem to be many (any?) other projects looking at what is possible if you implement async I/O purely on top of coroutines yet so I'm hoping to explore that space with cppcoro. It may be worthwhile separating out the platform-specific I/O bits of cppcoro to a separate library ( |
This is important, I think. The early adopters will want to integrate your abstractions into existing applications that already have an IO polling technology in place, and forcing them to change will be a barrier to adoption. To be clear, I'm 100% in favor of seeing what can be done purely with coroutines, but the IO stuff should be pluggable to the extent that's possible. |
I'll look at splitting cppcoro up into a couple of libraries: I'm thinking of rearranging the source tree like:
|
I just want to add my vote for splitting out the IO. We are about to undertake a large re-architecture, likely using coroutines and upon a brief look at cppcoro I see some really interesting things we could use. However, we will be using ASIO (Networking TS specifically) so a way to integrate them both would be very beneficial to us. |
@akoolenbourke asio already support co_await, but has't the core fundamental abstractions (task, async_generator, when_all(), etc.) . so if i want some async function to sync, it must need i am a coroutine expert. |
It would be good to cover the vision and strategy behind
io_service
in some doc or wiki. This is needed to have organized approach for supporting ageneric platform
.Why program platform-specific IO polling backend directly in this project instead of integrating with one of omni-platform IO polling libraries such as libevent, libev, libuv, or boost asio.
Re boost in particular, as I understand it, Networking TS is based on boost asio, and it has been accepted for C++20(?). So, would it not be best to integrate with boost io_service from this TS?
IO polling is inevitably related to multithreading. There are several popular models: single-threaded event loop (ex: libevent), single threaded polling with multithreaded event processing (ASIO), fully multithreaded polling and processing (GRPC). Where is this project stand in this regard? Is there some specific set of goals in mind? Perhaps, there is a perimeter beyond which this project should not go and leave the rest for custom integrations?
The text was updated successfully, but these errors were encountered: