Skip to content

Commit 0574e63

Browse files
committed
add chapter 13
1 parent 0e60452 commit 0574e63

File tree

3 files changed

+5
-0
lines changed

3 files changed

+5
-0
lines changed

book_cn/rust_concurrency_cookbook.pdf

77.6 KB
Binary file not shown.

rayon_examples/src/lib.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,4 +84,8 @@ pub fn rayon_threadpool_example() {
8484
let n = pool.install(|| fib(20));
8585

8686
println!("{}", n);
87+
}
88+
89+
pub fn rayon_global_thread_pool_example() {
90+
rayon::ThreadPoolBuilder::new().num_threads(22).build_global().unwrap();
8791
}

rayon_examples/src/main.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@ fn main() {
88
rayon_scope_example2();
99
rayon_scopefifo_example();
1010
rayon_threadpool_example();
11+
rayon_global_thread_pool_example();
1112
}

0 commit comments

Comments
 (0)