Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should hyperthreads be counted when disabled? #118

Open
reuvenpo opened this issue Feb 13, 2022 · 2 comments
Open

Should hyperthreads be counted when disabled? #118

reuvenpo opened this issue Feb 13, 2022 · 2 comments

Comments

@reuvenpo
Copy link

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!

@seanmonstar
Copy link
Owner

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

@reuvenpo
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants