#atomic #garbage #non-blocking #lock-free #rcu

bin+lib crossbeam

Support for concurrent programming: memory management, utilities, non-blocking data structures

25 releases

0.4.1 Jul 25, 2018
0.3.2 Jan 5, 2018
0.3.0 Aug 1, 2017
0.2.10 Aug 11, 2016
0.1.6 Nov 2, 2015

#15 in Concurrency

Download history 14954/week @ 2018-05-27 18284/week @ 2018-06-03 19077/week @ 2018-06-10 17112/week @ 2018-06-17 18357/week @ 2018-06-24 22880/week @ 2018-07-01 18581/week @ 2018-07-08 21818/week @ 2018-07-15 21422/week @ 2018-07-22 19631/week @ 2018-07-29 21969/week @ 2018-08-05 21407/week @ 2018-08-12 19959/week @ 2018-08-19

82,581 downloads per month
Used in 383 crates (108 directly)



Crossbeam: support for concurrent programming

Build Status License Cargo Documentation

Crossbeam supports concurrent programming, especially focusing on memory management, synchronization, and non-blocking data structures.

Crossbeam consists of several submodules:

  • atomic for enhancing std::sync API. AtomicConsume provides C/C++11-style "consume" atomic operations (re-exported from crossbeam-utils). ArcCell provides atomic storage and retrieval of Arc.

  • utils and thread for utilities, re-exported from crossbeam-utils. The "scoped" thread API in thread makes it possible to spawn threads that share stack data with their parents. The utils::CachePadded struct inserts padding to align data with the size of a cacheline. This crate also seeks to expand the standard library's few synchronization primitives (locks, barriers, etc) to include advanced/niche primitives, as well as userspace alternatives.

  • epoch for memory management, re-exported from crossbeam-epoch. Because non-blocking data structures avoid global synchronization, it is not easy to tell when internal data can be safely freed. The crate provides generic, easy to use, and high-performance APIs for managing memory in these cases. We plan to support other memory management schemes, e.g. hazard pointers (HP) and quiescent state-based reclamation (QSBR).

  • Concurrent data structures which are non-blocking and much superior to wrapping sequential ones with a Mutex. Crossbeam currently provides channels (re-exported from crossbeam-channel), deques (re-exported from crossbeam-deque), queues, and stacks. Ultimately the goal is to also include bags, sets and maps.


To use Crossbeam, add this to your Cargo.toml:

crossbeam = "0.4"

For examples of what Crossbeam is capable of, see the documentation.


~23K SLoC