Uh oh!
There was an error while loading. Please reload this page.
Implement Sync for SyncSender - #42397
Conversation
alexcrichton
commented
Jun 3, 2017
@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. |
BurntSushi
commented
Jun 3, 2017
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 |
sfackler
commented
Jun 3, 2017
The |
carols10cents
commented
Jun 12, 2017
ping @brson looks like you're the only remaining checkbox that's unchecked! |
rfcbot
commented
Jun 20, 2017
🔔 This is now entering its final comment period, as per the review above. 🔔 |
alexcrichton
commented
Jun 20, 2017
@bors: r+ |
bors
commented
Jun 20, 2017
📌 Commit 0f6c01d has been approved by |
Mark-Simulacrum
commented
Jun 20, 2017
@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>{pubfnshared(self) -> SharedSender<T>{// upgrade to Flavor::Shared, take shared::Packet, create SharedSender}}Likewise, we could introduce a new type |
alexcrichton
commented
Jul 17, 2017
@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 |
alexcrichton
commented
Jul 17, 2017
Heh sure!
So basically no real strong reason or regrets, just that if we started from scratch today I'd probably do things differently! |
sfackler
commented
Jul 17, 2017
The select infrastructure also makes the internals way more complex than they'd otherwise be. Sync channels can otherwise be nothing more than a |
alexcrichton
commented
Aug 1, 2017
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