Skip to content

Commit

Permalink
feat: improve
Browse files Browse the repository at this point in the history
  • Loading branch information
brglng committed Aug 26, 2024
1 parent d9d0288 commit 5296ce5
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ fn push(queues: &[PathQueue], index: usize, path: PathBuf) -> Result<()> {
}

fn breadth_first_traverse(prog: &str, cwd: &Path, opt: &Options, queues: &[PathQueue], index: usize, counter: &AtomicUsize) -> Result<()> {
let queue = &queues[index];
loop {
let path = pop_or_steal(queues, index)?;
if let Some(path) = path {
Expand Down Expand Up @@ -147,7 +146,7 @@ fn breadth_first_traverse(prog: &str, cwd: &Path, opt: &Options, queues: &[PathQ
} else if counter.load(Ordering::Acquire) == 0 {
break;
} else {
thread::sleep(Duration::from_millis(13));
thread::sleep(Duration::from_millis(7));
}
}
Ok(())
Expand Down Expand Up @@ -260,8 +259,7 @@ fn main() {

let mut queues = Vec::new();
for _ in 0..num_threads {
let q = PathQueue::new((1024 * 512 / num_threads) as u32,
(1024 * 512 / num_threads) as u32);
let q = PathQueue::new((1024 * 512 / num_threads) as u32, (1024 * 512 / num_threads) as u32);
if let Ok(q) = q {
queues.push(q);
} else {
Expand Down

0 comments on commit 5296ce5

Please sign in to comment.