Skip to content

Commit

Permalink
Update to rayon 1.6.1, remove jwalk_par_bridge
Browse files Browse the repository at this point in the history
jwalk had need custom par_bridge implementation to avoid locking in some cases. Rayon 1.6.1 makes this no longer a problem. See walk_rayon_no_lockup test case.
  • Loading branch information
jessegrosjean committed Dec 11, 2022
1 parent 9575132 commit 94c0385
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 228 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ crossbeam = "0.8"

[dev-dependencies]
criterion = "0.3"
fs_extra = "1.1"
fs_extra = "1.2"
walkdir = "2.3"
ignore = "0.4"
tempfile = "3.1"
Expand Down
223 changes: 0 additions & 223 deletions src/core/jwalk_par_bridge.rs

This file was deleted.

2 changes: 0 additions & 2 deletions src/core/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ mod dir_entry;
mod dir_entry_iter;
mod error;
mod index_path;
mod jwalk_par_bridge;
mod ordered;
mod ordered_queue;
mod read_dir;
Expand All @@ -21,7 +20,6 @@ use ordered_queue::*;
use read_dir_iter::*;
use run_context::*;

pub use self::jwalk_par_bridge::{JWalkIterBridge, JWalkParallelBridge};
pub use dir_entry::DirEntry;
pub use dir_entry_iter::DirEntryIter;
pub use error::Error;
Expand Down
2 changes: 1 addition & 1 deletion src/core/read_dir_iter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ impl<C: ClientState> ReadDirIter<C> {

parallelism.install(move || {
rayon::spawn(|| {
read_dir_spec_iter.jwalk_par_bridge().for_each_with(
read_dir_spec_iter.par_bridge().for_each_with(
run_context,
|run_context, ordered_read_dir_spec| {
multi_threaded_walk_dir(ordered_read_dir_spec, run_context);
Expand Down
4 changes: 3 additions & 1 deletion tests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1028,7 +1028,9 @@ fn walk_rayon_global() {

#[test]
fn walk_rayon_no_lockup() {
// Without jwalk_par_bridge this locks
// Without jwalk_par_bridge this locks (pre rayon 1.6.1)
// This test now passes without needing jwalk_par_bridge
// and that code has been removed from jwalk.
let pool = std::sync::Arc::new(
rayon::ThreadPoolBuilder::new()
.num_threads(1)
Expand Down

0 comments on commit 94c0385

Please sign in to comment.