We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0e60452 commit 0574e63Copy full SHA for 0574e63
book_cn/rust_concurrency_cookbook.pdf
77.6 KB
rayon_examples/src/lib.rs
@@ -84,4 +84,8 @@ pub fn rayon_threadpool_example() {
84
let n = pool.install(|| fib(20));
85
86
println!("{}", n);
87
+}
88
+
89
+pub fn rayon_global_thread_pool_example() {
90
+ rayon::ThreadPoolBuilder::new().num_threads(22).build_global().unwrap();
91
}
rayon_examples/src/main.rs
@@ -8,4 +8,5 @@ fn main() {
8
rayon_scope_example2();
9
rayon_scopefifo_example();
10
rayon_threadpool_example();
11
+ rayon_global_thread_pool_example();
12
0 commit comments