Description
I have a 32 core linux system and suddenly I found that NumCPU() was returning only two. After discussing about this in the slack channel we've realized that the Go process had a CPU affinity and only two processors were assigned to the process.
According to documentation I'd expect NumCPU() to return the amount of logical cores in the system independently of the process affinity. Also this might bring confusion as we've seen NumCPU() returning different values depending on the underlying platform.
Seems like either the docs need to be updated clarifying what NumCPU() does or implementation should be consistent among different platforms (taking into account process affinity or not).
In addition, it seems like Go only performs the check once. If the user changes the CPU affinity, NumCPU won't change