Skip to content

rts: Teach getNumProcessors to return available processors

Ben Gamari requested to merge wip/T14781 into master

Previously we would report the number of physical processors, which can be quite wrong in a containerized setting. Now we rather return how many processors are in our affinity mask when possible.

I also refactored the code to prefer platform-specific since this will report logical CPUs instead of physical (using machdep.cpu.thread_count on Darwin and cpuset_getaffinity on FreeBSD).

Also cleans up some old Windows compatibility shims.

Fixes #14781 (closed).

Merge request reports