Skip to content

Commit 8d2e048

Browse files
bors[bot]Aaron1011cuviper
committed
675: Update crossbeam-deque to 0.7 r=cuviper a=Aaron1011 The only substantive change is to 'take_local_job'. 'Worker::pop` now returns a plain 'Option<T>', so there's no need to loop anymore Co-authored-by: Aaron Hill <aa1ronham@gmail.com> Co-authored-by: Josh Stone <cuviper@gmail.com>
2 parents 678ffbb + 99706a4 commit 8d2e048

File tree

9 files changed

+25
-27
lines changed

9 files changed

+25
-27
lines changed

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ matrix:
99
fast_finish: true
1010
include:
1111
# NB: To help with CI delays, each `pull_request` is only tested on Linux,
12-
# with 1.26 for compatibility and stable+rayon_unstable for broad test
12+
# with 1.28 for compatibility and stable+rayon_unstable for broad test
1313
# coverage. The bors bot counts as a `push` type, which will run it all.
1414

15-
- rust: 1.26.0
15+
- rust: 1.28.0
1616
os: linux
1717
#if: everything!
1818
script: cargo build

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "rayon"
33
# Reminder to update html_rool_url in lib.rs when updating version
4-
version = "1.1.0"
4+
version = "1.2.0"
55
authors = ["Niko Matsakis <niko@alum.mit.edu>",
66
"Josh Stone <cuviper@gmail.com>"]
77
description = "Simple work-stealing parallelism for Rust"
@@ -18,8 +18,8 @@ members = ["rayon-demo", "rayon-core", "rayon-futures"]
1818
exclude = ["ci"]
1919

2020
[dependencies]
21-
rayon-core = { version = "1.5.0", path = "rayon-core" }
22-
crossbeam-deque = "0.6.3"
21+
rayon-core = { version = "1.6.0", path = "rayon-core" }
22+
crossbeam-deque = "0.7"
2323

2424
# This is a public dependency!
2525
[dependencies.either]

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ just add:
9090
use rayon::prelude::*;
9191
```
9292

93-
Rayon currently requires `rustc 1.26.0` or greater.
93+
Rayon currently requires `rustc 1.28.0` or greater.
9494

9595
## Contribution
9696

rayon-core/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "rayon-core"
3-
version = "1.5.0" # reminder to update html_root_url attribute
3+
version = "1.6.0" # reminder to update html_root_url attribute
44
authors = ["Niko Matsakis <niko@alum.mit.edu>",
55
"Josh Stone <cuviper@gmail.com>"]
66
description = "Core APIs for Rayon"
@@ -17,7 +17,7 @@ categories = ["concurrency"]
1717
[dependencies]
1818
num_cpus = "1.2"
1919
lazy_static = "1"
20-
crossbeam-deque = "0.6.3"
20+
crossbeam-deque = "0.7"
2121
crossbeam-queue = "0.1.2"
2222
crossbeam-utils = "0.6.5"
2323

rayon-core/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ Please see [Rayon Docs] for details about using Rayon.
88

99
[Rayon Docs]: https://docs.rs/rayon/
1010

11-
Rayon-core currently requires `rustc 1.26.0` or greater.
11+
Rayon-core currently requires `rustc 1.28.0` or greater.

rayon-core/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
//! conflicting requirements will need to be resolved before the build will
2020
//! succeed.
2121
22-
#![doc(html_root_url = "https://docs.rs/rayon-core/1.5")]
22+
#![doc(html_root_url = "https://docs.rs/rayon-core/1.6")]
2323
#![deny(missing_debug_implementations)]
2424
#![deny(missing_docs)]
2525
#![deny(unreachable_pub)]

rayon-core/src/registry.rs

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use crossbeam_deque::{self as deque, Pop, Steal, Stealer, Worker};
1+
use crossbeam_deque::{Steal, Stealer, Worker};
22
use crossbeam_queue::SegQueue;
33
#[cfg(rayon_unstable)]
44
use internal::task::Task;
@@ -224,11 +224,14 @@ impl Registry {
224224

225225
let (workers, stealers): (Vec<_>, Vec<_>) = (0..n_threads)
226226
.map(|_| {
227-
if breadth_first {
228-
deque::fifo()
227+
let worker = if breadth_first {
228+
Worker::new_fifo()
229229
} else {
230-
deque::lifo()
231-
}
230+
Worker::new_lifo()
231+
};
232+
233+
let stealer = worker.stealer();
234+
(worker, stealer)
232235
})
233236
.unzip();
234237

@@ -678,13 +681,7 @@ impl WorkerThread {
678681
/// bottom.
679682
#[inline]
680683
pub(super) unsafe fn take_local_job(&self) -> Option<JobRef> {
681-
loop {
682-
match self.worker.pop() {
683-
Pop::Empty => return None,
684-
Pop::Data(d) => return Some(d),
685-
Pop::Retry => {}
686-
}
687-
}
684+
self.worker.pop()
688685
}
689686

690687
/// Wait until the latch is set. Try to keep busy by popping and
@@ -767,7 +764,7 @@ impl WorkerThread {
767764
loop {
768765
match victim.stealer.steal() {
769766
Steal::Empty => return None,
770-
Steal::Data(d) => {
767+
Steal::Success(d) => {
771768
log!(StoleWork {
772769
worker: self.index,
773770
victim: victim_index

src/iter/par_bridge.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use crossbeam_deque::{self as deque, Steal, Stealer, Worker};
1+
use crossbeam_deque::{Steal, Stealer, Worker};
22

33
use std::sync::atomic::{AtomicBool, AtomicUsize, Ordering};
44
use std::sync::{Mutex, TryLockError};
@@ -79,7 +79,8 @@ where
7979
C: UnindexedConsumer<Self::Item>,
8080
{
8181
let split_count = AtomicUsize::new(current_num_threads());
82-
let (worker, stealer) = deque::fifo();
82+
let worker = Worker::new_fifo();
83+
let stealer = worker.stealer();
8384
let done = AtomicBool::new(false);
8485
let iter = Mutex::new((self.iter, worker));
8586

@@ -149,7 +150,7 @@ where
149150
{
150151
loop {
151152
match self.items.steal() {
152-
Steal::Data(it) => {
153+
Steal::Success(it) => {
153154
folder = folder.consume(it);
154155
if folder.full() {
155156
return folder;

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![doc(html_root_url = "https://docs.rs/rayon/1.1")]
1+
#![doc(html_root_url = "https://docs.rs/rayon/1.2")]
22
#![deny(missing_debug_implementations)]
33
#![deny(missing_docs)]
44
#![deny(unreachable_pub)]

0 commit comments

Comments
 (0)