Non-blocking variants of IpcReceiverSet::select#435
Merged
jdm merged 4 commits intoservo:mainfrom Jan 17, 2026
Merged
Conversation
40010b1 to
45c4d95
Compare
IpcReceiverSet::selectIpcReceiverSet::select
817affb to
97fd9e7
Compare
This includes unix, macOS, Windows, and in-process. For unix platform, see https://github.com/tokio-rs/mio/issues/1835for the justification of using a zero duration as a way of implementing a non-blocking poll. Ref: servo#434
1f578bc to
cf9e843
Compare
jdm
approved these changes
Jan 17, 2026
| ) -> Result<Vec<OsIpcSelectionResult>, OsTrySelectError> { | ||
| if self.receivers.is_empty() { | ||
| std::thread::sleep(duration); | ||
| if self.receivers.is_empty() { |
Member
There was a problem hiding this comment.
This has to be true, since this method is &mut self and receivers doesn't have any interior mutability.
| ) -> Result<Vec<OsIpcSelectionResult>, OsTrySelectError> { | ||
| if self.readers.len() + self.closed_readers.len() == 0 { | ||
| thread::sleep(Duration::from_millis(wait as u64)); | ||
| if self.readers.len() + self.closed_readers.len() == 0 { |
Member
There was a problem hiding this comment.
This is also true for the same reasons as the in-process backend.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 implements non-blocking variants of
IpcReceiverSet::selectfor unix variants, macOS, Windows, and in-process.Ref: #434