crossbeam is a Rust concurrency library used here for message-passing channels. Its channel API separates sending and receiving through tx and rx helper objects, hiding transmission details. section 10.4.4
Channel choices support different concurrency needs:
- Use unbounded queues when producers should not wait for available space. section 10.4.4
- Use bounded queues to apply back pressure and maintain deterministic maximum memory usage, accepting that producers may block. section 10.4.4
- Use channels as task queues when multiple work items may wait for a receiver. section 10.4.4
Sending a value across a thread
Create an unbounded channel, move tx into a spawned thread, send 42, and receive it with select!, producing Ok(42).
