Skip to content

Commit aa9b963

Browse files
committed
add more thread examples
1 parent 15e7ffc commit aa9b963

File tree

5 files changed

+356
-179
lines changed

5 files changed

+356
-179
lines changed

thread/Cargo.toml

+9
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,13 @@ edition = "2021"
66
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
77

88
[dependencies]
9+
send_wrapper = "0.6.0"
910
thread-priority = "0.9.2"
11+
thread-amount = "0.1.3"
12+
crossbeam = "0.8.2"
13+
thread-control = "0.1.2"
14+
affinity = "0.1.2"
15+
rayon = "1.5.3"
16+
go-spawn = "0.1.2"
17+
num_threads = "0.1.6"
18+
parking = "2.0.0"

thread/src/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
pub mod stdthread;
1+
pub mod threads;
22

3-
pub use stdthread::*;
3+
pub use threads::*;

thread/src/main.rs

+15-1
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,25 @@ fn main() {
88
thread_builder();
99

1010
start_one_thread_with_move();
11-
start_one_thread_with_thradlocal();
11+
start_one_thread_with_threadlocal();
1212

1313
thread_park();
1414
thread_park_timeout();
1515

1616
start_scoped_threads();
17+
crossbeam_scope();
18+
rayon_scope();
19+
20+
send_wrapper();
21+
22+
print_thread_amount();
23+
24+
control_thread();
25+
26+
use_affinity();
27+
28+
go_thread();
29+
30+
park_thread();
1731
}
1832

thread/src/stdthread.rs

-176
This file was deleted.

0 commit comments

Comments
 (0)