-
Notifications
You must be signed in to change notification settings - Fork 122
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
op: poll and poll_multi #255
Open
FrankReh
wants to merge
19
commits into
tokio-rs:master
Choose a base branch
from
FrankReh:frankreh/poll
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Commits on Feb 21, 2023
-
Adds new types: bufring::{BufRing, Builder}, bufgroup:{BufX, Bgid, Bid} (BufX was chosen as the name of the buffer type of this pool simply to make it short and easy to grep for.) bufgroup may be better named provbuf, or provided_buffers, down the road, especially if we intent to support the other, older, much less efficient provided buffer mechanism. But the liburing team specifically recommends the buf_ring implementation for ease of use and performance reasons so we may not want to incur the overhead of supporting both forms. bufring could become a trait down the road, where different BufRing implementations can be provided. But to avoid the extra decision making that comes with designing traits, and to keep the code relatively easy to follow, these are all concrate types. Adds register and unregister functionality to BufRing and to the tokio_uring driver. Adds experimental recv, recv_provbuf methods to TcpStream. recv_provbuf is a purposefully ugly name. It will be replaced by something ... maybe a recv builder sometimme soon. Whatever is chosen would then be copied for Udp, Unix and for all the other operations that optionally take a provided buffer pool id. Adds 'net' unit tests. All are admittedly simple ping/pong tests where only the clients' received lengths are checked, not the actual data. Adds a tests/common area. Adds a test case that uses two std::threads, where each thread runs its own tokio_uring runtime and its own buf_ring provided buffer pool. The two-thread case is made long, with many clients, sending many large messages to the server and getting them back, in order to see gross performance impacts when changing things. It takes 3s on my machine. Before going into mainline, the numbers would be changed so it took no more than the other unit tests, so about 10ms. Many TODOs left to cleanup. Primarily Safety rationalizations. The buffer allocation is made as a single allocation, along with the ring. The buffer group id, bgid, also sometimes called the provided buffer group id, is manually selected through the builder api. There is no mechanism to pick one automatically. That could be added later but is not really necessary for this feature to be useful. This first implementation is without traits and without public interfaces that would let a user create a different kind of buf_ring or a different kind of `provided buffers` pool. There's a question to the liburing team outstanding about how to interpret an unexpected cqe result of res=0 and flags=4.
Configuration menu - View commit details
-
Copy full SHA for d2b3418 - Browse repository at this point
Copy the full SHA d2b3418View commit details -
Configuration menu - View commit details
-
Copy full SHA for dbcbd8b - Browse repository at this point
Copy the full SHA dbcbd8bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 9ccadd8 - Browse repository at this point
Copy the full SHA 9ccadd8View commit details -
Configuration menu - View commit details
-
Copy full SHA for 300abc8 - Browse repository at this point
Copy the full SHA 300abc8View commit details -
Configuration menu - View commit details
-
Copy full SHA for a565029 - Browse repository at this point
Copy the full SHA a565029View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0969da3 - Browse repository at this point
Copy the full SHA 0969da3View commit details -
Configuration menu - View commit details
-
Copy full SHA for d40d0a7 - Browse repository at this point
Copy the full SHA d40d0a7View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5978032 - Browse repository at this point
Copy the full SHA 5978032View commit details -
Configuration menu - View commit details
-
Copy full SHA for bd09dee - Browse repository at this point
Copy the full SHA bd09deeView commit details -
Configuration menu - View commit details
-
Copy full SHA for 2029a20 - Browse repository at this point
Copy the full SHA 2029a20View commit details
Commits on Feb 22, 2023
-
Configuration menu - View commit details
-
Copy full SHA for 0f940c0 - Browse repository at this point
Copy the full SHA 0f940c0View commit details
Commits on Feb 24, 2023
-
Configuration menu - View commit details
-
Copy full SHA for 9387c92 - Browse repository at this point
Copy the full SHA 9387c92View commit details -
Configuration menu - View commit details
-
Copy full SHA for d885aa7 - Browse repository at this point
Copy the full SHA d885aa7View commit details
Commits on Feb 25, 2023
-
Configuration menu - View commit details
-
Copy full SHA for 7a98190 - Browse repository at this point
Copy the full SHA 7a98190View commit details
Commits on Feb 26, 2023
-
Configuration menu - View commit details
-
Copy full SHA for f6eafdb - Browse repository at this point
Copy the full SHA f6eafdbView commit details -
The first operation that supports streaming CQE results. Adds a Streamable trait, along the lines of the Completable trait. Comes with stream_next and stream_complete methods. Adds MultiCQEStream struct, along the lines of the MultiCQEFuture struct. Adds a submit_op_stream along the lines of submit_op. Adds poll_next_op along the lines of poll_op. The Lifecycle gets two additional methods: take_index, and data. take_index: returns the Lifecycle index and replaces it with usize::MAX to show the Lifecycle is no longer represented in the slab. This feature only used by the new poll_next_op. data: returns a reference to the Lifecycle's data, to be able to use it for the Streamable's stream_next calls which only require a reference. Ownership is still transferred in stream_complete. Adds the io/recv_multi operation. The tcp stream recv_multi is a function that bridges the private types with a public function. There is no cancel yet for the multishot command but the code can be written to break out of the loop. Also, when the connection is closed, the command should fail. It's not tested, but unregistering the buf_ring might cancel the command too - but maybe not. Unit tests: net unit tests and helper functions return io::Return add recv_multi cases add BufRingProps to net unit tests - to quiet empty buffer warnings which are intentional in some tests
Configuration menu - View commit details
-
Copy full SHA for be7cdd4 - Browse repository at this point
Copy the full SHA be7cdd4View commit details
Commits on Feb 27, 2023
-
Configuration menu - View commit details
-
Copy full SHA for d26f34a - Browse repository at this point
Copy the full SHA d26f34aView commit details
Commits on Feb 28, 2023
-
op: add accept_multi for TcpListener
And adds a unit test to tests/net.
Configuration menu - View commit details
-
Copy full SHA for 5139ae3 - Browse repository at this point
Copy the full SHA 5139ae3View commit details -
Configuration menu - View commit details
-
Copy full SHA for a89d404 - Browse repository at this point
Copy the full SHA a89d404View commit details
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.