Lesson 36 of 50
rustChannels and Message Passing
15 minutes
Course progress72%
Channels and Message Passing
std::sync::mpsc provides multi‑producer, single‑consumer channels.
use std::sync::mpsc;
use std::thread;
fn main() {
let (tx, rx) = mpsc::channel();
thread::spawn( || {
= \