#scoped #thread #atomic #cache

no-std crossbeam-utils

Utilities for concurrent programming

17 releases

0.6.6 Jul 24, 2019
0.6.5 Jan 29, 2019
0.6.3 Dec 11, 2018
0.6.1 Nov 12, 2018
0.2.1 Nov 26, 2017

#10 in Concurrency

Download history 122111/week @ 2019-04-10 106526/week @ 2019-04-17 108237/week @ 2019-04-24 103218/week @ 2019-05-01 103788/week @ 2019-05-08 113756/week @ 2019-05-15 124510/week @ 2019-05-22 127472/week @ 2019-05-29 127958/week @ 2019-06-05 124049/week @ 2019-06-12 121373/week @ 2019-06-19 116858/week @ 2019-06-26 99288/week @ 2019-07-03 101967/week @ 2019-07-10 106388/week @ 2019-07-17

486,199 downloads per month
Used in 4,234 crates (55 directly)

MIT/Apache

104KB
1.5K SLoC

Crossbeam Utils

Build Status License Cargo Documentation Rust 1.26+ chat

This crate provides miscellaneous 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)

Thread synchronization

  • 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.*

Usage

Add this to your Cargo.toml:

[dependencies]
crossbeam-utils = "0.6"

Next, add this to your crate:

extern crate crossbeam_utils;

License

Licensed under either of

at your option.

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.

Dependencies