seanmonstar / num_cpus

Get the number of CPUs in Rust
Apache License 2.0
582 stars 91 forks source link

Deprecate library? #119

Closed SUPERCILEX closed 2 years ago

SUPERCILEX commented 2 years ago

Or at least prominently point people towards std? https://doc.rust-lang.org/stable/std/thread/fn.available_parallelism.html

seanmonstar commented 2 years ago

Take a look at the limitations section on that function. This crate does check processor affinity, and cgroups, and doing so has an important impact on servers running in containers.

SUPERCILEX commented 2 years ago

Interesting, looks like there's a PR to fix that: https://github.com/rust-lang/rust/pull/92697. In the meantime, perhaps it's worth pointing out the differences?

pro465 commented 2 years ago

update: the mentioned PR is now merged

link2xt commented 2 years ago

Here async-global-executor crate switched to the standard API: https://github.com/async-rs/async-global-executor/pull/6

Here rayon crate is considering dropping the library: https://github.com/rayon-rs/rayon/pull/937

notgull commented 2 years ago

Either way, I feel like the important thing is that this crate is available on earlier versions of Rust, which is important to crates who don't want to bump their MSRV.

seanmonstar commented 2 years ago

Yea, probably not going to do this just yet.