windows-threading (0.100.0+paring.1)
Published 2026-10-14 03:21:29 +09:00 by paring
Installation
[registries.forgejo]
index = "sparse+ " # Sparse index
# index = " " # Git
[net]
git-fetch-with-cli = truecargo add windows-threading@0.100.0+paring.1 --registry forgejoAbout this package
Windows threading
windows-threading
The windows-threading crate wraps the Windows thread pool.
Start by adding the following to your Cargo.toml file:
[dependencies.windows-threading]
version = "0.100"
Submit work to the default pool:
windows_threading::submit(|| {
println!("thread: {}", windows_threading::thread_id());
loop {
println!(".");
windows_threading::sleep(1000);
}
});
Process an iterator in parallel:
let counter = std::sync::RwLock::<usize>::new(0);
windows_threading::for_each(0..10, |value| {
println!("thread: {}, value: {value}", windows_threading::thread_id());
let mut counter = counter.write().unwrap();
*counter += value;
});
assert_eq!(*counter.read().unwrap(), 45);
Dependencies
| ID | Version |
|---|---|
| windows-link | ^0.100.0 |
Details
2026-10-14 03:21:29 +09:00
2026-11-15 19:56:40 +09:00
Assets (1)
Versions (1)
View all
Cargo
21
MIT OR Apache-2.0
9.1 KiB
0.100.0+paring.1
2026-10-14