Repolode
crossbeam-rs

crossbeam-rs/crossbeam

A Rust crate of concurrency tools: lock-free queues, work-stealing deques, channels, epoch-based GC, atomics and scoped threads.

Stars
8,629
Forks
589
Open issues
173
Last commit
23 days ago

What is it?

Crossbeam is a Rust library of building blocks for concurrent programming. It covers atomics such as AtomicCell, lock-free data structures including bounded and unbounded MPMC queues, work-stealing deques, and an epoch-based garbage collector for safely reclaiming memory in concurrent structures.

It also includes multi-producer multi-consumer channels for message passing, a thread parking primitive, a sharded reader-writer lock, a WaitGroup for synchronizing computation boundaries, and scoped threads that can borrow local variables from the stack. The main crate re-exports tools from smaller subcrates, so a project can depend on the single crossbeam package.

Many of the components can be used in no_std environments, with some requiring the alloc feature. The minimum supported Rust version is 1.74.

Key features

  • 01Lock-free bounded and unbounded MPMC queues (ArrayQueue, SegQueue)
  • 02Work-stealing deques for building task schedulers
  • 03Multi-producer multi-consumer channels for message passing
  • 04Epoch-based garbage collection for concurrent data structures
  • 05Atomics, thread parking, sharded RwLock, WaitGroup and scoped threads
  • 06Several components usable in no_std environments

Use cases

  • Building a multithreaded task scheduler with work-stealing deques
  • Passing messages between threads with MPMC channels
  • Sharing a queue among many producers and consumers without locks
  • Spawning threads that borrow data from the current stack frame

Quick start

  1. 1

    Add crossbeam as a dependency in Cargo.toml

  2. 2

    Add the crossbeam dependency with Cargo

    crossbeam = "0.8"

Things to know

  • Minimum supported Rust version is 1.74.

Topics

FAQ

What is crossbeam?
A Rust crate of concurrency tools: lock-free queues, work-stealing deques, channels, epoch-based GC, atomics and scoped threads. Crossbeam is a Rust library of building blocks for concurrent programming. It covers atomics such as AtomicCell, lock-free data structures including bounded and unbounded MPMC queues, work-stealing deques, and an epoch-based garbage collector for safely reclaiming memory in concurrent structures.
Is crossbeam free to use? What license does it have?
crossbeam is open source under the Apache-2.0 license. Check the license terms before using it in commercial products.
Is crossbeam still maintained?
Actively maintained. The last commit to crossbeam was on Oct 1, 2026.
What can I use crossbeam for?
Building a multithreaded task scheduler with work-stealing deques Passing messages between threads with MPMC channels Sharing a queue among many producers and consumers without locks Spawning threads that borrow data from the current stack frame
How do I install crossbeam?
Add crossbeam as a dependency in Cargo.toml Add the crossbeam dependency with Cargo: crossbeam = "0.8"
Where can I get crossbeam?
The source code and installation instructions are on GitHub: https://github.com/crossbeam-rs/crossbeam

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects