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 resolves #39 by adding an alternative
Reactor
that usesio_uring
in addition toepoll
as a backend on Linux.Changes this PR makes to the architecture of
async-io
:reactor.rs
is turned into a folder, containing two implementations ofReactor
that are selected at compile time throughcfg-if
.Reactor
has been moved topoll.rs
. It is used on nontarget_os = "linux"
platforms.Reactor
inuring.rs
is present. Instead of just usingpolling
, it usesio_uring
, but uses that system to wait for readiness onepoll
.Reactor
has two new methods:poll_read
andpoll_write
, which are now called byAsync
's impls ofAsyncRead
andAsyncWrite
. On the pollingReactor
, it is the same as the previous implementation. On the newReactor
, it files newRead
/Write
entries in the submission queue.io_uring
isn't available, it falls back to the previous reactor.Reasons why I'm filing it as a draft instead of as a full PR:
Poller
polling#39 to be released.Current issues:
Source
buffer that theio_uring
operations read from/write to, instead of the buffers passed in by the user. This is because theio_uring
temporarily takes ownership of the buffer, and that's invalid to do with the current model. However, for large reads/writes, this may incur a performance penalty. Open to suggestions on how to fix this.io_uring
crate or our implementation.Potential future work:
io_uring
supports quite a few different operations that we could also integrate into it.io_uring
is available.