29 releases (6 breaking)
|0.7.1||Jan 29, 2019|
|0.6.0||Dec 16, 2018|
|0.5.0||Nov 9, 2018|
|0.4.1||Jul 25, 2018|
|0.1.6||Nov 2, 2015|
#6 in Concurrency
151,480 downloads per month
Used in 406 crates (126 directly)
This crate provides a set of tools for concurrent programming:
AtomicCell, a thread-safe mutable memory location.(*)
AtomicConsume, for reading from primitive atomic types with "consume" ordering.(*)
deque, work-stealing deques for building task schedulers.
ArrayQueue, a bounded MPMC queue that allocates a fixed-capacity buffer on construction.
SegQueue, an unbounded MPMC queue that allocates small buffers, segments, on demand.
epoch, an epoch-based garbage collector.(**)
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.
Backoff, for exponential backoff in spin loops.(*)
CachePadded, for padding and aligning a value to the length of a cache line.(*)
scope, for spawning threads that borrow local variables from the stack.
*Features marked with (*) can be used in
Features marked with (**) can be used in
crossbeam crate just re-exports tools from
crossbeam-channelprovides multi-producer multi-consumer channels for message passing.
crossbeam-dequeprovides work-stealing deques, which are primarily intended for building task schedulers.
crossbeam-epochprovides epoch-based garbage collection for building concurrent data structures.
crossbeam-queueprovides concurrent queues that can be shared among threads.
crossbeam-utilsprovides atomics, synchronization primitives, scoped threads, and other utilities.
There is one more experimental subcrate that is not yet included in
crossbeam-skiplistprovides concurrent maps and sets based on lock-free skip lists.
Add this to your
[dependencies] crossbeam = "0.7"
Next, add this to your crate:
extern crate crossbeam;
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.
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.
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.
The Crossbeam project adheres to the Rust Code of Conduct. This describes the minimum behavior expected from all contributors.
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.
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.