#thread-pool #thread #pool #parallelism #threading #per-thread

affinitypool

A Rust library for running blocking jobs on a dedicated thread pool with CPU core affinity

8 releases

new 0.3.1 Jan 28, 2025
0.3.0 Jan 27, 2025
0.2.1 Jan 16, 2025
0.1.3 Jan 12, 2025

#327 in Concurrency

Download history 158/week @ 2024-12-31 393/week @ 2025-01-07 545/week @ 2025-01-14 178/week @ 2025-01-21

1,277 downloads per month

MIT/Apache

34KB
530 lines

affinitypool

A threadpool for running blocking jobs on a dedicated thread pool. Blocking tasks can be sent asynchronously to the pool, where the task will be queued until a worker thread is free to process the task. Tasks are processed in a FIFO order.

For optimised workloads, the affinity of each thread can be specified, ensuring that each thread can request to be pinned to a certain CPU core, allowing for more parallelism, and better performance guarantees for blocking workloads.

Original

This code is heavily inspired by threadpool, licensed under the Apache License 2.0 and MIT licenses.

Dependencies

~2.6–8.5MB
~71K SLoC