just icon indicating copy to clipboard operation
just copied to clipboard

Could the num_cpus dependency be replaced by std::thread::available_parallelism?

Open averms opened this issue 8 months ago • 3 comments

From looking at the implementation of both and the discussion on https://github.com/seanmonstar/num_cpus I get the impression that this would not be a breaking change.

averms avatar Mar 31 '25 23:03 averms

Can you link to the discussion you're referring to?

casey avatar Apr 01 '25 05:04 casey

seanmonstar/num_cpus#130 and seanmonstar/num_cpus#117.

averms avatar Apr 01 '25 06:04 averms

I'm open to this, since removing a dependency is always a good idea. First though, I would want to understand in what circumstances num_cpus and available_parallelism will return different answers. Also, people might be using num_cpus to print out system specs, so if the change to available_parallelism would break that, we can't do it. This doesn't preclude adding a new function available_parallelism.

casey avatar Apr 03 '25 19:04 casey