]> git.proxmox.com Git - rustc.git/blob - vendor/crossbeam-utils-0.6.5/README.md
New upstream version 1.41.1+dfsg1
[rustc.git] / vendor / crossbeam-utils-0.6.5 / README.md
1 # Crossbeam Utils
2
3 [![Build Status](https://travis-ci.org/crossbeam-rs/crossbeam.svg?branch=master)](
4 https://travis-ci.org/crossbeam-rs/crossbeam)
5 [![License](https://img.shields.io/badge/license-MIT%2FApache--2.0-blue.svg)](
6 https://github.com/crossbeam-rs/crossbeam-utils/tree/master/src)
7 [![Cargo](https://img.shields.io/crates/v/crossbeam-utils.svg)](
8 https://crates.io/crates/crossbeam-utils)
9 [![Documentation](https://docs.rs/crossbeam-utils/badge.svg)](
10 https://docs.rs/crossbeam-utils)
11 [![Rust 1.26+](https://img.shields.io/badge/rust-1.26+-lightgray.svg)](
12 https://www.rust-lang.org)
13
14 This crate provides miscellaneous tools for concurrent programming:
15
16 #### Atomics
17
18 * [`AtomicCell`], a thread-safe mutable memory location.<sup>(\*)</sup>
19 * [`AtomicConsume`], for reading from primitive atomic types with "consume" ordering.<sup>(\*)</sup>
20
21 #### Thread synchronization
22
23 * [`Parker`], a thread parking primitive.
24 * [`ShardedLock`], a sharded reader-writer lock with fast concurrent reads.
25 * [`WaitGroup`], for synchronizing the beginning or end of some computation.
26
27 #### Utilities
28
29 * [`Backoff`], for exponential backoff in spin loops.<sup>(\*)</sup>
30 * [`CachePadded`], for padding and aligning a value to the length of a cache line.<sup>(\*)</sup>
31 * [`scope`], for spawning threads that borrow local variables from the stack.
32
33 *Features marked with <sup>(\*)</sup> can be used in `no_std` environments.*
34
35 [`AtomicCell`]: https://docs.rs/crossbeam-utils/*/crossbeam_utils/atomic/struct.AtomicCell.html
36 [`AtomicConsume`]: https://docs.rs/crossbeam-utils/*/crossbeam_utils/atomic/trait.AtomicConsume.html
37 [`Parker`]: https://docs.rs/crossbeam-utils/*/crossbeam_utils/sync/struct.Parker.html
38 [`ShardedLock`]: https://docs.rs/crossbeam-utils/*/crossbeam_utils/sync/struct.ShardedLock.html
39 [`WaitGroup`]: https://docs.rs/crossbeam-utils/*/crossbeam_utils/sync/struct.WaitGroup.html
40 [`Backoff`]: https://docs.rs/crossbeam-utils/*/crossbeam_utils/struct.Backoff.html
41 [`CachePadded`]: https://docs.rs/crossbeam-utils/*/crossbeam_utils/struct.CachePadded.html
42 [`scope`]: https://docs.rs/crossbeam-utils/*/crossbeam_utils/thread/fn.scope.html
43
44 ## Usage
45
46 Add this to your `Cargo.toml`:
47
48 ```toml
49 [dependencies]
50 crossbeam-utils = "0.6"
51 ```
52
53 Next, add this to your crate:
54
55 ```rust
56 extern crate crossbeam_utils;
57 ```
58
59 ## License
60
61 Licensed under either of
62
63 * Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)
64 * MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)
65
66 at your option.
67
68 #### Contribution
69
70 Unless you explicitly state otherwise, any contribution intentionally submitted
71 for inclusion in the work by you, as defined in the Apache-2.0 license, shall be
72 dual licensed as above, without any additional terms or conditions.