liveBook · Manning

Crossbeam

As explained in Rust in Action: Systems programming concepts and techniques

crossbeam is a Rust library providing concurrency primitives and utilities, including message-passing channels.

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).

How Rust in Action: Systems programming concepts and techniques covers it

How deep it goes
Explains channel endpoints, boundedness, back pressure, and working programs, but does not expose transmission internals.
Examples
Builds channel examples sending integers, exchanging Ping and Pong messages, and queueing render-hex work.
What it assumes
Assumes basic Rust threads and Cargo usage while introducing channel endpoints, queue behavior, and task-queue design.
What you can do after
Builds Rust programs that send messages between threads and select bounded or unbounded queues for workloads.
How it connects
Connects channels with Rust threads, message passing, task queues, thread pools, and std::sync::mpsc.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Rust in Action: Systems programming concepts and techniques. The section links point to the parts of the book it draws on.