Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.