]> git.proxmox.com Git - rustc.git/blob - vendor/crossbeam-utils-0.7.2/README.md
New upstream version 1.49.0~beta.4+dfsg1
[rustc.git] / vendor / crossbeam-utils-0.7.2 / 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.28+](https://img.shields.io/badge/rust-1.28+-lightgray.svg)](
12 https://www.rust-lang.org)
13 [![chat](https://img.shields.io/discord/569610676205781012.svg?logo=discord)](https://discord.gg/BBYwKq)
14
15 This crate provides miscellaneous tools for concurrent programming:
16
17 #### Atomics
18
19 * [`AtomicCell`], a thread-safe mutable memory location.<sup>(no_std)</sup>
20 * [`AtomicConsume`], for reading from primitive atomic types with "consume" ordering.<sup>(no_std)</sup>
21
22 #### Thread synchronization
23
24 * [`Parker`], a thread parking primitive.
25 * [`ShardedLock`], a sharded reader-writer lock with fast concurrent reads.
26 * [`WaitGroup`], for synchronizing the beginning or end of some computation.
27
28 #### Utilities
29
30 * [`Backoff`], for exponential backoff in spin loops.<sup>(no_std)</sup>
31 * [`CachePadded`], for padding and aligning a value to the length of a cache line.<sup>(no_std)</sup>
32 * [`scope`], for spawning threads that borrow local variables from the stack.
33
34 *Features marked with <sup>(no_std)</sup> can be used in `no_std` environments.*<br/>
35
36 [`AtomicCell`]: https://docs.rs/crossbeam-utils/*/crossbeam_utils/atomic/struct.AtomicCell.html
37 [`AtomicConsume`]: https://docs.rs/crossbeam-utils/*/crossbeam_utils/atomic/trait.AtomicConsume.html
38 [`Parker`]: https://docs.rs/crossbeam-utils/*/crossbeam_utils/sync/struct.Parker.html
39 [`ShardedLock`]: https://docs.rs/crossbeam-utils/*/crossbeam_utils/sync/struct.ShardedLock.html
40 [`WaitGroup`]: https://docs.rs/crossbeam-utils/*/crossbeam_utils/sync/struct.WaitGroup.html
41 [`Backoff`]: https://docs.rs/crossbeam-utils/*/crossbeam_utils/struct.Backoff.html
42 [`CachePadded`]: https://docs.rs/crossbeam-utils/*/crossbeam_utils/struct.CachePadded.html
43 [`scope`]: https://docs.rs/crossbeam-utils/*/crossbeam_utils/thread/fn.scope.html
44
45 ## Usage
46
47 Add this to your `Cargo.toml`:
48
49 ```toml
50 [dependencies]
51 crossbeam-utils = "0.7"
52 ```
53
54 Next, add this to your crate:
55
56 ```rust
57 extern crate crossbeam_utils;
58 ```
59
60 ## Compatibility
61
62 The minimum supported Rust version is 1.28. Any change to this is considered a breaking change.
63
64 ## License
65
66 Licensed under either of
67
68 * Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)
69 * MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)
70
71 at your option.
72
73 #### Contribution
74
75 Unless you explicitly state otherwise, any contribution intentionally submitted
76 for inclusion in the work by you, as defined in the Apache-2.0 license, shall be
77 dual licensed as above, without any additional terms or conditions.