-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Tracking Issue for mpmc
#126840
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
Comments
Add multi-producer, multi-consumer channel (mpmc) Closes rust-lang#125712 Tracking issue: rust-lang#126840 r? m-ou-se
The This shouldn't affect any usage of them, except for the slightly different documentation provided. |
I wonder if there's a downside to |
fix doc for std::sync::mpmc fix document of `std::sync::mpmc` (tracked in rust-lang#126840)
fix doc for std::sync::mpmc fix document of `std::sync::mpmc` (tracked in rust-lang#126840)
Rollup merge of rust-lang#135876 - usamoi:mpmc-doc, r=tgross35 fix doc for std::sync::mpmc fix document of `std::sync::mpmc` (tracked in rust-lang#126840)
fix doc for std::sync::mpmc fix document of `std::sync::mpmc` (tracked in rust-lang#126840)
Does this channel deliver each value to all receivers? Or is it intended for building work queues? This is unclear from the existing documentation. A multi-consumer channel with backpressure like this one would be most welcome in our application! Thanks everyone who is pushing this forward! |
Great question! I've been digging around in the channels code recently trying to understand the precise behaviour and I can't see any evidence of each value being delivered to all receivers. In fact, there are a few indications that delivering each value to all receivers is not the intended behaviour:
Comments:
|
…=jhpratt Basic tests of MPMC receiver cloning Ref: rust-lang#126840 (comment)
…=jhpratt Basic tests of MPMC receiver cloning Ref: rust-lang#126840 (comment)
@andrew-otiv I can confirm the following behaviour:
Notes:
|
Thanks for clarifying that! I was hoping for a broadcast channel with try_send so we can panic when the buffer fills. In our application deadlocking or blowing up an unbounded buffer until OOM are both worse than crashing. Every multi consumer channel in both tokio and std can either block the sender, silently "leak" until oom, or drop values. |
Rollup merge of rust-lang#139836 - glyn:test-mpmc-receiver-cloning, r=jhpratt Basic tests of MPMC receiver cloning Ref: rust-lang#126840 (comment)
I am not sure I quite understand your problem.
So the problem with this is that it drops in-flight values if the last receiver is dropped before all values are received? Edit: Could there be a miscommunication of what it means that each value is delivered to only one receiver instead of being delivered to all receivers? My understanding is the following:
|
Basic tests of MPMC receiver cloning Ref: rust-lang/rust#126840 (comment)
Feature gate:
#![feature(mpmc_channel)]
This is a tracking issue for
mpmc_channel
as described in ACP.History
The text was updated successfully, but these errors were encountered: