Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
C

crossbeam

> 编程语言
Open source

Tools for concurrent programming in Rust

8.5K stars0 likes3 views
WebsiteGitHub

About

Tools for concurrent programming in Rust

Crossbeam

This crate provides a set of tools for concurrent programming:

Atomics

  • AtomicCell, a thread-safe mutable memory location.(no_std)
  • AtomicConsume, for reading from primitive atomic types with "consume" ordering.(no_std)

Data structures

  • deque, work-stealing deques for building task schedulers.
  • ArrayQueue, a bounded MPMC queue that allocates a fixed-capacity buffer on construction.(alloc)
  • SegQueue, an unbounded MPMC queue that allocates small buffers, segments, on demand.(alloc)

Memory management

  • epoch, an epoch-based garbage collector.(alloc)

Thread synchronization

  • channel, multi-producer multi-consumer channels for message passing.
  • Parker, a thread parking primitive.
  • ShardedLock, a sharded reader-writer lock with fast concurrent reads.
  • WaitGroup, for synchronizing the beginning or end of some computation.

Utilities

  • Backoff, for exponential backoff in spin loops.(no_std)
  • CachePadded, for padding and aligning a value to the length of a cache line.(no_std)
  • scope, for spawning threads that borrow local variables from the stack.

Features marked with (no_std) can be used in no_std environments.
Features marked with (alloc) can be used in no_std environments, but only if alloc feature is enabled.

Crates

The main crossbeam crate just re-exports tools from smaller subcrates:

  • crossbeam-channel provides multi-producer multi-consumer channels for message passing.
  • crossbeam-deque provides work-stealing deques, which are primarily intended for building task schedulers.
  • crossbeam-epoch provides epoch-based garbage collection for building concurrent data structures.
  • crossbeam-queue provides concurrent queues that can be shared among threads.
  • crossbeam-utils provides atomics, synchronization primitives, scoped threads, and other utilities.

There is one more experimental subcrate that is not yet included in crossbeam:

  • crossbeam-skiplist provides concurrent maps and sets based on lock-free skip lists.

Usage

Add this to your Cargo.toml:

toml
[dependencies]
crossbeam = "0.8"

Compatibility

Crossbeam supports stable Rust releases going back at least one year, and every time the minimum supported Rust version is increased, a new minor version is released. Currently, the minimum supported Rust version is 1.74.

Contributing

Crossbeam welcomes contribution from everyone in the form of suggestions, bug reports, pull requests, and feedback.

If you need ideas for contribution, there are several ways to get started:

  • Found a bug or have a feature request? Submit an issue!
  • Issues and PRs labeled with feedback wanted need feedback from users and contributors.
  • Issues labeled with good first issue are relatively easy starter issues.

RFCs

We also have the RFCs repository for more high-level discussion, which is the place where we brainstorm ideas and propose substantial changes to Crossbeam.

You are welcome to participate in any open issues or pull requests.

Learning resources

If you'd like to learn more about concurrency and non-blocking data structures, there's a list of learning resources in our wiki, which includes relevant blog posts, papers, videos, and other similar projects.

Another good place to visit is merged RFCs. They contain elaborate descriptions and rationale for features we've introduced to Crossbeam, but keep in mind that some of the written information is now out of date.

Conduct

The Crossbeam project adheres to the Rust Code of Conduct. This describes the minimum behavior expected from all contributors.

License

Licensed under either of

  • Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
  • MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)

at your option.

Some Crossbeam subcrates have additional licensing notices. Take a look at other readme files in this repository for more information.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Issues· 163 open

View all issuesOpen on GitHub
  • #503

    Publish version 1.0

    Updated Sep 7, 2026
  • #1282

    ci: Re-enable armv5te by fixing flaky tests

    Updated Sep 5, 2026
  • #1303

    &mut self APIs for skiplist

    Updated Aug 6, 2026
  • #821

    crossbeam-channel uses pure userspace spinlocks, which perform very poorly in some situations

    crossbeam-channelUpdated Jul 12, 2026
  • #1253

    The documentation example about `T: Send` not being required for `Guard::defer_destroy` does not apply to the function

    Updated May 5, 2026
  • #1249

    Efficient `SkipList::range().count()`

    featurecrossbeam-skiplistUpdated Apr 20, 2026
  • #1228

    Would it make sense to impliment Drain on SegQueue

    featurecrossbeam-queueUpdated Mar 12, 2026
  • #675

    Document that SegQueue is not completely lock free

    docscrossbeam-queueUpdated Mar 5, 2026
  • #720

    no way to set max capacity size of deque

    questioncrossbeam-dequeUpdated Feb 21, 2026
  • #812

    Provide an example for crossbeam-deque

    crossbeam-dequedocsUpdated Feb 21, 2026

> Tags

Rustconcurrencydata-structureslock-freeparallelism

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 30, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言