-
Notifications
You must be signed in to change notification settings - Fork 91
Fix getOptimalThreadCount segfault #714
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
base: master
Are you sure you want to change the base?
Fix getOptimalThreadCount segfault #714
Conversation
…ached method is also not 100% necessary
} | ||
return physicalCoreCount; | ||
#endif | ||
// in ARM and RISKV we only need this |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ivansarno, Am I correct in assuming that RISK-V CPUs do not have Hyper-threading?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, no widely used RISC-V core has hyperthreading, except perhaps some experimental core.
It seems that the method used in master is not compatible with very old kernels.
I replaced here with using
/sys/devices/system/cpu/present
which should be compatible with Linux kernels 2.6+.I also added a print to time how long it takes. Optimizing this avoiding heap allocations and std::set did not make a meaningful time difference so I left the easiest implementation.