Use std::thread::available_parallelism()
instead of num_cpus
dependency
#257
Milestone
std::thread::available_parallelism()
instead of num_cpus
dependency
#257
We might want to replace a dependency
num_cpus
crate withstd::thread::available_parallelism()
once we updatemoka
's minimum supported Rust version (MSRV) to Rust 1.64.std::thread::available_parallelism()
function was added to Rust 1.59.0.See rayon-rs/rayon#937 for details.
Without Linux cgroup v1/v2 support,
available_parallelism()
will ignore the CPU quota provided by a Linux container runtime such as Docker.Rust 1.64.0 was released on September 22, 2022. It was 7 months ago from now and our MSRV policy already allows Rust 1.64.0.
https://github.com/moka-rs/moka/#minimum-supported-rust-versions
As of
moka
v0.10, it usesnum_cpus
to decide the number of global worker threads. In the future, we will remove the worker threads, but we will start to use it to decide the number of the internal hash table segments.The text was updated successfully, but these errors were encountered: