forked from libp2p/rust-libp2p
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Refactor UdpMuxNewAddr
to be lock-less
#1
Merged
melekes
merged 24 commits into
melekes:anton/webrtc-transport
from
thomaseizinger:rewrite-udp-mux
Aug 31, 2022
Merged
Refactor UdpMuxNewAddr
to be lock-less
#1
melekes
merged 24 commits into
melekes:anton/webrtc-transport
from
thomaseizinger:rewrite-udp-mux
Aug 31, 2022
Commits on Aug 2, 2022
-
Dirty PoC for lock-less UdpMuxNewAddr
The general idea is this: We use `flume` channels between the actual `UdpMuxNewAddr` instance and a set of "handles", one per async-trait that we need to satisfy. There is only one instance of `UdpMuxNewAddr`, meaning we can access it via `&mut self` and drop all locks within it. In the poll function, we can then decide, which events to prioritise over others. Most importantly, all channels between handles and the actual instance are "rendezvous channels", meaning, sending will block until we actually read the item out of the channel. This allows us to enforce backpressure from the poll function all the way to all handles and into the task that is interacting with the handle.
Configuration menu - View commit details
-
Copy full SHA for 9b298e2 - Browse repository at this point
Copy the full SHA 9b298e2View commit details -
Configuration menu - View commit details
-
Copy full SHA for f5483e7 - Browse repository at this point
Copy the full SHA f5483e7View commit details
Commits on Aug 3, 2022
-
Configuration menu - View commit details
-
Copy full SHA for a137a07 - Browse repository at this point
Copy the full SHA a137a07View commit details -
Configuration menu - View commit details
-
Copy full SHA for 8f522bb - Browse repository at this point
Copy the full SHA 8f522bbView commit details -
Configuration menu - View commit details
-
Copy full SHA for 9d9c9a4 - Browse repository at this point
Copy the full SHA 9d9c9a4View commit details -
Configuration menu - View commit details
-
Copy full SHA for 54444b7 - Browse repository at this point
Copy the full SHA 54444b7View commit details -
Configuration menu - View commit details
-
Copy full SHA for ce44836 - Browse repository at this point
Copy the full SHA ce44836View commit details -
Configuration menu - View commit details
-
Copy full SHA for c111c46 - Browse repository at this point
Copy the full SHA c111c46View commit details
Commits on Aug 18, 2022
-
Configuration menu - View commit details
-
Copy full SHA for ac14b9f - Browse repository at this point
Copy the full SHA ac14b9fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 3c214cb - Browse repository at this point
Copy the full SHA 3c214cbView commit details -
Configuration menu - View commit details
-
Copy full SHA for eb35b18 - Browse repository at this point
Copy the full SHA eb35b18View commit details -
Configuration menu - View commit details
-
Copy full SHA for 744ad62 - Browse repository at this point
Copy the full SHA 744ad62View commit details -
Configuration menu - View commit details
-
Copy full SHA for eb976f2 - Browse repository at this point
Copy the full SHA eb976f2View commit details -
Configuration menu - View commit details
-
Copy full SHA for 8a77b6e - Browse repository at this point
Copy the full SHA 8a77b6eView commit details
Commits on Aug 29, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 6d49c5a - Browse repository at this point
Copy the full SHA 6d49c5aView commit details -
Never have more than one write future
This is to ensure backpressure. To not loose drop any packets, we only read from the socket in case we are not currently writing a packet.
Configuration menu - View commit details
-
Copy full SHA for 521da48 - Browse repository at this point
Copy the full SHA 521da48View commit details -
Configuration menu - View commit details
-
Copy full SHA for 676d50d - Browse repository at this point
Copy the full SHA 676d50dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 9a32e4f - Browse repository at this point
Copy the full SHA 9a32e4fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 64f8021 - Browse repository at this point
Copy the full SHA 64f8021View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1d8094b - Browse repository at this point
Copy the full SHA 1d8094bView commit details -
Configuration menu - View commit details
-
Copy full SHA for cc66761 - Browse repository at this point
Copy the full SHA cc66761View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6bce388 - Browse repository at this point
Copy the full SHA 6bce388View commit details
Commits on Aug 30, 2022
-
Instead of buffering multiple items, we only ever buffer one. To work off this queue as quickly as possible, we put it at the top of the loop which allows us to reduce some code duplication by writing directly to the buffer in case we popped an item off the queue and going back to the start of the loop which will trigger a different code branch.
Configuration menu - View commit details
-
Copy full SHA for 16fb8e4 - Browse repository at this point
Copy the full SHA 16fb8e4View commit details -
Configuration menu - View commit details
-
Copy full SHA for 211baae - Browse repository at this point
Copy the full SHA 211baaeView 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.