That's true, github.com/rust-lang/rust/pull/93563 was merged just this past November 🎉 ~With that said, afaik, there's still no way to fulfill the multiple-producer-multiple-consumer pattern w/ the standard library's crate as `std::sync::mpmc` is still private: play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=3650e906a764237c3d49cd572610a289
@@danlogs what is the advantage of the multiple consumer pattern? Is it faster? I don't see the advantage of that over having a single consumer in the main function that is receiving all messages
@@osgiliath_burns ~ It's not really about performance but more about the fact that sometimes, you just need multiple consumers. For example, say you have a system receiving different types of data, like temperature readings, humidity levels, and error messages from sensors. Instead of one consumer sorting and handling everything, you could have: - One consumer dedicated to handling temperature data, - Another for humidity, - And a third just for error messages. This way, each consumer only deals with what it needs to, making the code cleaner and easier to work with when you’re handling multiple tasks at once.
Dude dont stop making videos, youre the only one whose video i can watch once and understand everything
Rust concurrency now crystal clear. Thanks !
Suggestion to work on volume.
Ah finally a new video. I really appreciate your videos. Thanks!
Really nice and useful video. Well explained!
the std::sync::mpsc is using crossbeam under the hood since ~Feb 2022, if no other features of crossbeam are used, you can avoid a dependency :)
That's true, github.com/rust-lang/rust/pull/93563 was merged just this past November 🎉 ~With that said, afaik, there's still no way to fulfill the multiple-producer-multiple-consumer pattern w/ the standard library's crate as `std::sync::mpmc` is still private: play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=3650e906a764237c3d49cd572610a289
@@danlogs what is the advantage of the multiple consumer pattern? Is it faster? I don't see the advantage of that over having a single consumer in the main function that is receiving all messages
@@osgiliath_burns ~ It's not really about performance but more about the fact that sometimes, you just need multiple consumers. For example, say you have a system receiving different types of data, like temperature readings, humidity levels, and error messages from sensors. Instead of one consumer sorting and handling everything, you could have:
- One consumer dedicated to handling temperature data,
- Another for humidity,
- And a third just for error messages.
This way, each consumer only deals with what it needs to, making the code cleaner and easier to work with when you’re handling multiple tasks at once.
Thanks for uploading this and keep up the good work!
Thanks man
14:00 The fact that I watched this video before and still used mspc channels makes me so mad right now lol
Been a lil bit 🤏