num_cpus icon indicating copy to clipboard operation
num_cpus copied to clipboard

Should hyperthreads be counted when disabled?

Open reuvenpo opened this issue 3 years ago • 2 comments

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!

reuvenpo avatar Feb 13 '22 15:02 reuvenpo

If it's easy and portable to detect, it'd be good to support that.

seanmonstar avatar Feb 13 '22 16:02 seanmonstar

I suspect that it is, since top & htop detect and display only 4 cores, but I have no idea which interfaces are involved.

reuvenpo avatar Feb 14 '22 11:02 reuvenpo