-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Fix mpsc::SyncSender
spinning behavior
#106701
Conversation
(rustbot has picked a reviewer for you, use r? to override) |
Hey! It looks like you've submitted a new PR for the library teams! If this PR contains changes to any Examples of
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The current documentation around Backoff seems to be inconsistent with how it is actually used in the mpmc implementation, so (if we keep the current behavior) I would suggest updating it. rust/library/std/src/sync/mpmc/utils.rs Lines 107 to 110 in f8276c9
rust/library/std/src/sync/mpmc/utils.rs Line 123 in f8276c9
|
I reviewed the current usage and think it is fine. @bors r+ Separately, I think the retry loop when sending a message should be removed (like we did with the similar loop in |
…anieu Fix `mpsc::SyncSender` spinning behavior Resolves rust-lang#106668.
…anieu Fix `mpsc::SyncSender` spinning behavior Resolves rust-lang#106668.
…iaskrgr Rollup of 10 pull requests Successful merges: - rust-lang#104645 (Add log-backtrace option to show backtraces along with logging) - rust-lang#106465 (Bump `IMPLIED_BOUNDS_ENTAILMENT` to Deny + ReportNow) - rust-lang#106489 (Fix linker detection for linker (drivers) with a version postfix (e.g. clang-12 instead of clang)) - rust-lang#106585 (When suggesting writing a fully qualified path probe for appropriate types) - rust-lang#106641 (Provide help on closures capturing self causing borrow checker errors) - rust-lang#106678 (Warn when using panic-strategy abort for proc-macro crates) - rust-lang#106701 (Fix `mpsc::SyncSender` spinning behavior) - rust-lang#106793 (Normalize test output more thoroughly) - rust-lang#106797 (riscv: Fix ELF header flags) - rust-lang#106813 (Remove redundant session field) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
I agree, the original reasoning was that it is similar to acquiring a mutex, but the difference is that bounded channels are often used with heavy backpressure, so a quick unpark is often not expected. |
…mulacrum [beta] backport rollup * Revert "Make nested RPITIT inherit the parent opaque's generics." rust-lang#106759 * Fix mpsc::SyncSender spinning behavior rust-lang#106701 * rustdoc: fix outdated lint section of the book rust-lang#106605 * Do not filter substs in remap_generic_params_to_declaration_params. rust-lang#106503 * Correct detection of elided lifetimes in impl-trait. rust-lang#106501 * Bump rust-installer rust-lang#106196 * Don't panic on stable since miri is not available there rust-lang#105901
…anieu Remove optimistic spinning from `mpsc::SyncSender` Per rust-lang#106701 (comment). Closes rust-lang#106804 r? `@Amanieu`
Remove optimistic spinning from `mpsc::SyncSender` Per rust-lang/rust#106701 (comment). Closes #106804 r? `@Amanieu`
Resolves #106668.