crossbeam-0.8.4/.cargo_vcs_info.json 0000644 00000000136 00000000001 0013023 0 ustar {
"git": {
"sha1": "9c3182abebb36bdc9446d75d4644190fef70fa01"
},
"path_in_vcs": ""
} crossbeam-0.8.4/CHANGELOG.md 0000644 0000000 0000000 00000006037 10461020230 0013432 0 ustar 0000000 0000000 # Version 0.8.4
- Remove dependency on `cfg-if`. (#1072)
# Version 0.8.3
- Bump the minimum supported Rust version to 1.61. (#1037)
# Version 0.8.2
- Bump the minimum supported Rust version to 1.38. (#877)
# Version 0.8.1
- Support targets that do not have atomic CAS on stable Rust (#698)
# Version 0.8.0
- Bump the minimum supported Rust version to 1.36.
- Bump `crossbeam-channel` to `0.5`.
- Bump `crossbeam-deque` to `0.8`.
- Bump `crossbeam-epoch` to `0.9`.
- Bump `crossbeam-queue` to `0.3`.
- Bump `crossbeam-utils` to `0.8`.
# Version 0.7.3
- Fix breakage with nightly feature due to rust-lang/rust#65214.
- Bump `crossbeam-channel` to `0.4`.
- Bump `crossbeam-epoch` to `0.8`.
- Bump `crossbeam-queue` to `0.2`.
- Bump `crossbeam-utils` to `0.7`.
# Version 0.7.2
- Bump `crossbeam-channel` to `0.3.9`.
- Bump `crossbeam-epoch` to `0.7.2`.
- Bump `crossbeam-utils` to `0.6.6`.
# Version 0.7.1
- Bump `crossbeam-utils` to `0.6.5`.
# Version 0.7.0
- Remove `ArcCell`, `MsQueue`, and `TreiberStack`.
- Change the interface of `ShardedLock` to match `RwLock`.
- Add `SegQueue::len()`.
- Rename `SegQueue::try_pop()` to `SegQueue::pop()`.
- Change the return type of `SegQueue::pop()` to `Result`.
- Introduce `ArrayQueue`.
- Update dependencies.
# Version 0.6.0
- Update dependencies.
# Version 0.5.0
- Update `crossbeam-channel` to 0.3.
- Update `crossbeam-utils` to 0.6.
- Add `AtomicCell`, `SharedLock`, and `WaitGroup`.
# Version 0.4.1
- Fix a double-free bug in `MsQueue` and `SegQueue`.
# Version 0.4
- Switch to the new implementation of epoch-based reclamation in
[`crossbeam-epoch`](https://github.com/crossbeam-rs/crossbeam-epoch), fixing numerous bugs in the
old implementation. Its API is changed in a backward-incompatible way.
- Switch to the new implementation of `CachePadded` and scoped thread in
[`crossbeam-utils`](https://github.com/crossbeam-rs/crossbeam-utils). The scoped thread API is
changed in a backward-incompatible way.
- Switch to the new implementation of Chase-Lev deque in
[`crossbeam-deque`](https://github.com/crossbeam-rs/crossbeam-deque). Its API is changed in a
backward-incompatible way.
- Export channel implemented in
[`crossbeam-channel`](https://github.com/crossbeam-rs/crossbeam-channel).
- Remove `AtomicOption`.
- Implement `Default` and `From` traits.
# Version 0.3
- Introduced `ScopedThreadBuilder` with the ability to name threads and set stack size
- `Worker` methods in the Chase-Lev deque don't require mutable access anymore
- Fixed a bug when unblocking `pop()` in `MsQueue`
- Implemented `Drop` for `MsQueue`, `SegQueue`, and `TreiberStack`
- Implemented `Default` for `TreiberStack`
- Added `is_empty` to `SegQueue`
- Renamed `mem::epoch` to `epoch`
- Other bug fixes
# Version 0.2
- Changed existing non-blocking `pop` methods to `try_pop`
- Added blocking `pop` support to Michael-Scott queue
- Added Chase-Lev work-stealing deque
# Version 0.1
- Added [epoch-based memory management](http://aturon.github.io/blog/2015/08/27/epoch/)
- Added Michael-Scott queue
- Added Segmented array queue
crossbeam-0.8.4/Cargo.toml 0000644 00000003502 00000000001 0011021 0 ustar # THIS FILE IS AUTOMATICALLY GENERATED BY CARGO
#
# When uploading crates to the registry Cargo will automatically
# "normalize" Cargo.toml files for maximal compatibility
# with all versions of Cargo and also rewrite `path` dependencies
# to registry (e.g., crates.io) dependencies.
#
# If you are reading this file be aware that the original Cargo.toml
# will likely look very different (and much more reasonable).
# See Cargo.toml.orig for the original contents.
[package]
edition = "2021"
rust-version = "1.61"
name = "crossbeam"
version = "0.8.4"
exclude = [
"/.*",
"/ci",
"/tools",
]
description = "Tools for concurrent programming"
homepage = "https://github.com/crossbeam-rs/crossbeam"
readme = "README.md"
keywords = [
"atomic",
"garbage",
"non-blocking",
"lock-free",
"rcu",
]
categories = [
"concurrency",
"memory-management",
"data-structures",
"no-std",
]
license = "MIT OR Apache-2.0"
repository = "https://github.com/crossbeam-rs/crossbeam"
[dependencies.crossbeam-channel]
version = "0.5.10"
optional = true
default-features = false
[dependencies.crossbeam-deque]
version = "0.8.4"
optional = true
default-features = false
[dependencies.crossbeam-epoch]
version = "0.9.17"
optional = true
default-features = false
[dependencies.crossbeam-queue]
version = "0.3.10"
optional = true
default-features = false
[dependencies.crossbeam-utils]
version = "0.8.18"
default-features = false
[dev-dependencies.rand]
version = "0.8"
[features]
alloc = [
"crossbeam-epoch/alloc",
"crossbeam-queue/alloc",
]
default = ["std"]
nightly = [
"crossbeam-epoch/nightly",
"crossbeam-utils/nightly",
"crossbeam-queue/nightly",
]
std = [
"alloc",
"crossbeam-channel/std",
"crossbeam-deque/std",
"crossbeam-epoch/std",
"crossbeam-queue/std",
"crossbeam-utils/std",
]
crossbeam-0.8.4/Cargo.toml.orig 0000644 0000000 0000000 00000004166 10461020230 0014511 0 ustar 0000000 0000000 [package]
name = "crossbeam"
# When publishing a new version:
# - Update CHANGELOG.md
# - Update README.md
# - Create "crossbeam-X.Y.Z" git tag
version = "0.8.4"
edition = "2021"
rust-version = "1.61"
license = "MIT OR Apache-2.0"
repository = "https://github.com/crossbeam-rs/crossbeam"
homepage = "https://github.com/crossbeam-rs/crossbeam"
description = "Tools for concurrent programming"
keywords = ["atomic", "garbage", "non-blocking", "lock-free", "rcu"]
categories = ["concurrency", "memory-management", "data-structures", "no-std"]
exclude = ["/.*", "/ci", "/tools"]
[features]
default = ["std"]
# Enable to use APIs that require `std`.
# This is enabled by default.
std = [
"alloc",
"crossbeam-channel/std",
"crossbeam-deque/std",
"crossbeam-epoch/std",
"crossbeam-queue/std",
"crossbeam-utils/std",
]
# Enable to use APIs that require `alloc`.
# This is enabled by default and also enabled if the `std` feature is enabled.
alloc = ["crossbeam-epoch/alloc", "crossbeam-queue/alloc"]
# Enable to use of unstable functionality.
# This is disabled by default and requires recent nightly compiler.
#
# NOTE: This feature is outside of the normal semver guarantees and minor or
# patch versions of crossbeam may make breaking changes to them at any time.
nightly = ["crossbeam-epoch/nightly", "crossbeam-utils/nightly", "crossbeam-queue/nightly"]
[dependencies]
crossbeam-channel = { version = "0.5.10", path = "crossbeam-channel", default-features = false, optional = true }
crossbeam-deque = { version = "0.8.4", path = "crossbeam-deque", default-features = false, optional = true }
crossbeam-epoch = { version = "0.9.17", path = "crossbeam-epoch", default-features = false, optional = true }
crossbeam-queue = { version = "0.3.10", path = "crossbeam-queue", default-features = false, optional = true }
crossbeam-utils = { version = "0.8.18", path = "crossbeam-utils", default-features = false }
[dev-dependencies]
rand = "0.8"
[workspace]
resolver = "2"
members = [
".",
"crossbeam-channel",
"crossbeam-channel/benchmarks",
"crossbeam-deque",
"crossbeam-epoch",
"crossbeam-queue",
"crossbeam-skiplist",
"crossbeam-utils",
]
crossbeam-0.8.4/LICENSE-APACHE 0000644 0000000 0000000 00000025144 10461020230 0013545 0 ustar 0000000 0000000 Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright 2019 The Crossbeam Project Developers
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
crossbeam-0.8.4/LICENSE-MIT 0000644 0000000 0000000 00000002113 10461020230 0013244 0 ustar 0000000 0000000 The MIT License (MIT)
Copyright (c) 2019 The Crossbeam Project Developers
Permission is hereby granted, free of charge, to any
person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the
Software without restriction, including without
limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software
is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice
shall be included in all copies or substantial portions
of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
crossbeam-0.8.4/README.md 0000644 0000000 0000000 00000015413 10461020230 0013076 0 ustar 0000000 0000000 # Crossbeam
[](
https://github.com/crossbeam-rs/crossbeam/actions)
[](
https://github.com/crossbeam-rs/crossbeam#license)
[](
https://crates.io/crates/crossbeam)
[](
https://docs.rs/crossbeam)
[](
https://www.rust-lang.org)
[](https://discord.com/invite/JXYwgWZ)
This crate provides a set of 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)
#### Data structures
* [`deque`], work-stealing deques for building task schedulers.
* [`ArrayQueue`], a bounded MPMC queue that allocates a fixed-capacity buffer on construction.(alloc)
* [`SegQueue`], an unbounded MPMC queue that allocates small buffers, segments, on demand.(alloc)
#### Memory management
* [`epoch`], an epoch-based garbage collector.(alloc)
#### Thread synchronization
* [`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.
#### 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.*
*Features marked with (alloc) can be used in `no_std` environments, but only if `alloc`
feature is enabled.*
[`AtomicCell`]: https://docs.rs/crossbeam/*/crossbeam/atomic/struct.AtomicCell.html
[`AtomicConsume`]: https://docs.rs/crossbeam/*/crossbeam/atomic/trait.AtomicConsume.html
[`deque`]: https://docs.rs/crossbeam/*/crossbeam/deque/index.html
[`ArrayQueue`]: https://docs.rs/crossbeam/*/crossbeam/queue/struct.ArrayQueue.html
[`SegQueue`]: https://docs.rs/crossbeam/*/crossbeam/queue/struct.SegQueue.html
[`channel`]: https://docs.rs/crossbeam/*/crossbeam/channel/index.html
[`Parker`]: https://docs.rs/crossbeam/*/crossbeam/sync/struct.Parker.html
[`ShardedLock`]: https://docs.rs/crossbeam/*/crossbeam/sync/struct.ShardedLock.html
[`WaitGroup`]: https://docs.rs/crossbeam/*/crossbeam/sync/struct.WaitGroup.html
[`epoch`]: https://docs.rs/crossbeam/*/crossbeam/epoch/index.html
[`Backoff`]: https://docs.rs/crossbeam/*/crossbeam/utils/struct.Backoff.html
[`CachePadded`]: https://docs.rs/crossbeam/*/crossbeam/utils/struct.CachePadded.html
[`scope`]: https://docs.rs/crossbeam/*/crossbeam/fn.scope.html
## Crates
The main `crossbeam` crate just [re-exports](src/lib.rs) tools from
smaller subcrates:
* [`crossbeam-channel`](crossbeam-channel)
provides multi-producer multi-consumer channels for message passing.
* [`crossbeam-deque`](crossbeam-deque)
provides work-stealing deques, which are primarily intended for building task schedulers.
* [`crossbeam-epoch`](crossbeam-epoch)
provides epoch-based garbage collection for building concurrent data structures.
* [`crossbeam-queue`](crossbeam-queue)
provides concurrent queues that can be shared among threads.
* [`crossbeam-utils`](crossbeam-utils)
provides atomics, synchronization primitives, scoped threads, and other utilities.
There is one more experimental subcrate that is not yet included in `crossbeam`:
* [`crossbeam-skiplist`](crossbeam-skiplist)
provides concurrent maps and sets based on lock-free skip lists.
## Usage
Add this to your `Cargo.toml`:
```toml
[dependencies]
crossbeam = "0.8"
```
## Compatibility
Crossbeam supports stable Rust releases going back at least six months,
and every time the minimum supported Rust version is increased, a new minor
version is released. Currently, the minimum supported Rust version is 1.61.
## Contributing
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](https://github.com/crossbeam-rs/crossbeam/issues/new)!
* Issues and PRs labeled with
[feedback wanted](https://github.com/crossbeam-rs/crossbeam/issues?utf8=%E2%9C%93&q=is%3Aopen+sort%3Aupdated-desc+label%3A%22feedback+wanted%22+)
need feedback from users and contributors.
* Issues labeled with
[good first issue](https://github.com/crossbeam-rs/crossbeam/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc+label%3A%22good+first+issue%22)
are relatively easy starter issues.
#### RFCs
We also have the [RFCs](https://github.com/crossbeam-rs/rfcs) repository for more
high-level discussion, which is the place where we brainstorm ideas and propose
substantial changes to Crossbeam.
You are welcome to participate in any open
[issues](https://github.com/crossbeam-rs/rfcs/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc)
or
[pull requests](https://github.com/crossbeam-rs/rfcs/pulls?q=is%3Apr+is%3Aopen+sort%3Aupdated-desc).
#### Learning resources
If you'd like to learn more about concurrency and non-blocking data structures, there's a
list of learning resources in our [wiki](https://github.com/crossbeam-rs/rfcs/wiki),
which includes relevant blog posts, papers, videos, and other similar projects.
Another good place to visit is [merged RFCs](https://github.com/crossbeam-rs/rfcs/tree/master/text).
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.
#### Conduct
The Crossbeam project adheres to the
[Rust Code of Conduct](https://www.rust-lang.org/policies/code-of-conduct).
This describes the minimum behavior expected from all contributors.
## License
Licensed under either of
* Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)
* MIT license ([LICENSE-MIT](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.
#### 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.
crossbeam-0.8.4/build-common.rs 0000644 0000000 0000000 00000000742 10461020230 0014551 0 ustar 0000000 0000000 // The target triplets have the form of 'arch-vendor-system'.
//
// When building for Linux (e.g. the 'system' part is
// 'linux-something'), replace the vendor with 'unknown'
// so that mapping to rust standard targets happens correctly.
fn convert_custom_linux_target(target: String) -> String {
let mut parts: Vec<&str> = target.split('-').collect();
let system = parts.get(2);
if system == Some(&"linux") {
parts[1] = "unknown";
};
parts.join("-")
}
crossbeam-0.8.4/no_atomic.rs 0000644 0000000 0000000 00000000500 10461020230 0014124 0 ustar 0000000 0000000 // This file is @generated by no_atomic.sh.
// It is not intended for manual editing.
const NO_ATOMIC: &[&str] = &[
"bpfeb-unknown-none",
"bpfel-unknown-none",
"mipsel-sony-psx",
"msp430-none-elf",
"riscv32i-unknown-none-elf",
"riscv32im-unknown-none-elf",
"riscv32imc-unknown-none-elf",
];
crossbeam-0.8.4/src/lib.rs 0000644 0000000 0000000 00000004716 10461020230 0013526 0 ustar 0000000 0000000 //! Tools for concurrent programming.
//!
//! ## Atomics
//!
//! * [`AtomicCell`], a thread-safe mutable memory location.
//! * [`AtomicConsume`], for reading from primitive atomic types with "consume" ordering.
//!
//! ## Data structures
//!
//! * [`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.
//!
//! ## Memory management
//!
//! * [`epoch`], an epoch-based garbage collector.
//!
//! ## Thread synchronization
//!
//! * [`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.
//!
//! ## Utilities
//!
//! * [`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.
//!
//! [`AtomicCell`]: atomic::AtomicCell
//! [`AtomicConsume`]: atomic::AtomicConsume
//! [`ArrayQueue`]: queue::ArrayQueue
//! [`SegQueue`]: queue::SegQueue
//! [`Parker`]: sync::Parker
//! [`ShardedLock`]: sync::ShardedLock
//! [`WaitGroup`]: sync::WaitGroup
//! [`Backoff`]: utils::Backoff
//! [`CachePadded`]: utils::CachePadded
#![doc(test(
no_crate_inject,
attr(
deny(warnings, rust_2018_idioms),
allow(dead_code, unused_assignments, unused_variables)
)
))]
#![warn(
missing_docs,
missing_debug_implementations,
rust_2018_idioms,
unreachable_pub
)]
#![cfg_attr(not(feature = "std"), no_std)]
pub use crossbeam_utils::atomic;
pub mod utils {
//! Miscellaneous utilities.
//!
//! * [`Backoff`], for exponential backoff in spin loops.
//! * [`CachePadded`], for padding and aligning a value to the length of a cache line.
pub use crossbeam_utils::Backoff;
pub use crossbeam_utils::CachePadded;
}
#[cfg(feature = "alloc")]
#[doc(inline)]
pub use {crossbeam_epoch as epoch, crossbeam_queue as queue};
#[cfg(feature = "std")]
#[doc(inline)]
pub use {
crossbeam_channel as channel, crossbeam_channel::select, crossbeam_deque as deque,
crossbeam_utils::sync,
};
#[cfg(feature = "std")]
#[cfg(not(crossbeam_loom))]
pub use crossbeam_utils::thread::{self, scope};
crossbeam-0.8.4/tests/subcrates.rs 0000644 0000000 0000000 00000001603 10461020230 0015316 0 ustar 0000000 0000000 //! Makes sure subcrates are properly re-exported.
use crossbeam::select;
#[test]
fn channel() {
let (s, r) = crossbeam::channel::bounded(1);
select! {
send(s, 0) -> res => res.unwrap(),
recv(r) -> res => assert!(res.is_ok()),
}
}
#[test]
fn deque() {
let w = crossbeam::deque::Worker::new_fifo();
w.push(1);
let _ = w.pop();
}
#[test]
#[cfg_attr(miri, ignore)] // Miri ICE: https://github.com/crossbeam-rs/crossbeam/pull/870#issuecomment-1189209073
fn epoch() {
crossbeam::epoch::pin();
}
#[test]
fn queue() {
let a = crossbeam::queue::ArrayQueue::new(10);
let _ = a.push(1);
let _ = a.pop();
}
#[test]
fn utils() {
crossbeam::utils::CachePadded::new(7);
crossbeam::scope(|scope| {
scope.spawn(|_| ());
})
.unwrap();
crossbeam::thread::scope(|scope| {
scope.spawn(|_| ());
})
.unwrap();
}