Crossbeam supports concurrent programming, especially focusing on memory management, synchronization, and non-blocking data structures.
Crossbeam consists of several submodules:
AtomicConsumeprovides C/C++11-style "consume" atomic operations (re-exported from [
ArcCellprovides atomic storage and retrieval of
threadfor utilities, re-exported from [
crossbeam-utils]. The "scoped" thread API in
threadmakes it possible to spawn threads that share stack data with their parents. The
utils::CachePaddedstruct 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.
epochfor 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.
Additional utilities for atomics.
Multi-producer multi-consumer channels for message passing.
A concurrent work-stealing deque.
Epoch-based memory reclamation.
Utilities for thread synchronization.
Threads that can borrow variables from the stack.
Utilities for concurrent programming.
Creates a new