What's the point of multi-producer multi-consumer channels when the receiving channel needs to be wrapped in a Mutex to be read from multiple therads?

Viewed 271

I'm looking at Flume's unbounded channel (mpmc), but i'm confused why it's named as it is, because the consumer channel needs to be wrapped in a mutex in order to receive messages from it from multiple threads? What would the difference between an mpmc and mpsc be then?

1 Answers

Someone on the Rust Community Discord gave me an answer:

I was told that flume::Receiver implements Clone + Send + Sync so it needn't be wrapped in a Mutex. And I simply just need to clone a reference the receiver and send it off to threads.

Related