-
Notifications
You must be signed in to change notification settings - Fork 226
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
[WIP] Operation pools POC #209
base: master
Are you sure you want to change the base?
Conversation
Sorry, I can't quite get the problem you want to solve. Now the model is like:
Under what circumstances would we want to call asynchronous code from synchronous code? |
I decided not to use async approach because I don't want to do memory allocation on task::spawn(). I plan to run my appication with callback-based approach like this
So I need a lower level IO driver rather than IO runtime. I don't know if monoio wants to expose cross-platform driver but I found an alternative that provides public driver. |
Please give some time to investigate it... |
Any updates? |
I have an update from my side - I've customized completion-style IO driver backed by Summary of customizations:
|
This PR is not finished and mostly done to discuss my ideas and get feedback.
I'm exploring monoio for my project and would like to split execution of a single thread application into synchronous and asynchronous parts (sync/async).
In other words I see it as a loop that interleaves between
I see the async part as a single future that always completes within timeout limit.
Besides I need some way to pass execution context between sync and async parts. I don't like approaches with returning BoxFuture's or spawning async tasks because I prefer to do allocations only during application startup.
One option that I started to implement in this PR is to have an API oriented on batched operations similar to IO uring:
user_data
and is not sent via the ringIf the ring is full, don't issue
submit
syscall but queue in the driver - to postpone context switch to asynchronous codeOpPools::submit
?) for at least one of operations in a batch is completeduser_data
index, get context of the application-level operations andAnother idea is to establish configurable in compile time resource limits:
max total number of outstanding IO Uring operations
max number of outstanding operations of each type - for example,
I included in the POC
AcceptPool
structure thatResult processing is expected to return the acquired allocated resources to the pool.
Each IO operation could have it's own pool and driver could have configured pools for all operations (see
OpPools
structure).I would like to get feedback and check if the project is aligned with the illustrated ideas.