-
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
Implement Sync for SyncSender #42397
Conversation
@rfcbot fcp merge |
Team member @alexcrichton has proposed to merge this. The next step is review by the rest of the tagged teams: No concerns currently listed. Once these reviewers reach consensus, this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up! See this document for info about what commands tagged team members can give me. |
Is there context on this? Was there something preventing this from happening sooner? Related RFC? https://github.com/seanmonstar/rfcs/blob/shared-sender/text/0000-shared-sender.md |
The |
ping @brson looks like you're the only remaining checkbox that's unchecked! |
🔔 This is now entering its final comment period, as per the review above. 🔔 |
@bors: r+ |
📌 Commit 0f6c01d has been approved by |
@bors rollup |
…chton Implement Sync for SyncSender r? @alexcrichton
Sorry for being late to the party. I feel like the full implications of this change were not thorougly discussed, so I'd like to clear up the confusion. We have two kinds of channels:
Both kinds of channels are MPSC - in other words, they allow multiple senders, but only one receiver. Should these types implement Before answering this question, let's take a look at the how the channels are implemented:
An alternative solution was proposed in this RFC, introducing a new type impl<T: Send> Sender<T> {
pub fn shared(self) -> SharedSender<T> {
// upgrade to Flavor::Shared, take shared::Packet, create SharedSender
}
} Likewise, we could introduce a new type |
@stjepang thanks for the comment! I think you're spot on with your conclusions. That being said I've often somewhat regretted the specialization of mpsc channels here in libstd, they're probably out of place at this point in time... In any case the implementation of @rust-lang/libs this is still possible to revert though I think as it's just going to beta soon (not stable). I personally would love to have a |
@alexcrichton Personally I'm not too opposed to having
I'd love to hear more - what in particular you're regretting and why? At the moment I'm working on a crate that provides MPMC channels (it aims to fix the usual pain points with |
Heh sure!
So basically no real strong reason or regrets, just that if we started from scratch today I'd probably do things differently! |
The select infrastructure also makes the internals way more complex than they'd otherwise be. Sync channels can otherwise be nothing more than a |
The libs team got a chance to discuss this during triage today, and the conclusion was that the likelihood of us taking advantage of |
r? @alexcrichton