num_cpus
num_cpus copied to clipboard
Should hyperthreads be counted when disabled?
I'm working with an intel CPU that has 4 cores and 8 hyperthreads, but the hyperthreads have been disabled in the bios (for various application-specific reasons). In this configuration num_cpus::get() still returns 8.
Is this intentional behavior or a consequence of my weird setup? Ideally it should return 4 in this case since there are only 4 parallel threads available.
Thanks in advance!
If it's easy and portable to detect, it'd be good to support that.
I suspect that it is, since top & htop detect and display only 4 cores, but I have no idea which interfaces are involved.