Skip to content

Commit

Permalink
document how to use rayon as well as semver policy
Browse files Browse the repository at this point in the history
  • Loading branch information
nikomatsakis committed Jun 14, 2017
1 parent 448baab commit a46de7a
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions README.md
Expand Up @@ -32,6 +32,33 @@ integers, please see the [notes on atomicity](#atomicity).

Rayon currently requires `rustc 1.12.0` or greater.

### Using Rayon

[Rayon is available on crates.io](https://crates.io/crates/rayon). The
recommended way to use it is to add a line into your Cargo.toml such
as:

```rust
[dependencies]
rayon = XXX # <-- insert latest version of Rayon from crates.io here
```

and then add the following to to your `lib.rs`:

```rust
extern crate rayon;
```

To use the Parallel Iterator APIs, a number of traits have to be in
scope. The easiest way to bring those things into scope is to use the
[Rayon prelude](https://docs.rs/rayon/0.8.0/rayon/prelude/index.html).
In each module where you would like to use the parallel iterator APIs,
just add:

```rust
use rayon::prelude::*;
```

### Contribution

Rayon is an open source project! If you'd like to contribute to Rayon, check out [the list of "help wanted" issues](https://github.com/nikomatsakis/rayon/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22). These are all (or should be) issues that are suitable for getting started, and they generally include a detailed set of instructions for what to do. Please ask questions if anything is unclear! Also, check out the [Guide to Development](https://github.com/nikomatsakis/rayon/wiki/Guide-to-Development) page on the wiki. Note that all code submitted in PRs to Rayon is assumed to [be licensed under Rayon's dual MIT/Apache2 licensing](https://github.com/nikomatsakis/rayon/blob/master/README.md#license).
Expand Down Expand Up @@ -395,6 +422,25 @@ fn search(path: &Path, cost_so_far: usize, best_cost: &Arc<AtomicUsize>) {
Now in this case, we really WANT to see results from other threads
interjected into our execution!

## Semver policy, the rayon-core crate, and unstable features

Rayon follows semver versioning. However, we also have APIs that are
still in the process of development and which may break from release
to release -- those APIs are not subject to semver. They are
accessible with the "unstable" cargo feature. Please do give them a
try -- but if you are using them, be aware that you (and all of your
dependencies!) will have to stay current with Rayon.

Rayon itself is internally split into two crates. The `rayon` crate is
intended to be the main, user-facing crate, and hence all the
documentation refers to `rayon`. This crate is still evolving and
regularly goes through (minor) breaking changes. The `rayon-core`
crate contains the global thread-pool and defines the core APIs: we no
longer permit breaking changes in this crate (except to unstable
features). The intention is that multiple semver-incompatible versions
of the rayon crate can peacefully coexist; they will all share one
global thread-pool through the `rayon-core` crate.

## License

Rayon is distributed under the terms of both the MIT license and the
Expand Down

0 comments on commit a46de7a

Please sign in to comment.