windows-threading
Safe access to the Windows thread pool, including scoped tasks that borrow local data. Use it for CPU or blocking work that does not need a dedicated thread.
Get started
[]
= "0.101"
let total = new;
for_each;
assert_eq!;
Choose lifetime and concurrency
submit runs a Send + 'static closure on the default pool without waiting. for_each waits for
all items to finish, so its closure can borrow local data.
Use Pool for a private pool and Pool::scope for borrowing tasks. Dropping a pool waits for its
work to finish. Avoid waiting on tasks queued to the same constrained pool, and handle expected
failures inside callbacks rather than panicking.
Use a dedicated thread for work requiring a stable thread identity or apartment. The pool sample shows scoped work and thread limits.