🎉 Celebrating 25 Years of GameDev.net! 🎉
Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!
Num Processors Linux
I am using GetSystemInfo in Windows to find the number of physical processors/cores in a machine. Then I am scaling my custom thread pool accordingly. What I am looking for is an equivalent function for Linux, and I would prefer not to use any assembly to do this.
Anyone know of a library function for this?
Quote: Original post by Wolfdog
I am using GetSystemInfo in Windows to find the number of physical processors/cores in a machine. Then I am scaling my custom thread pool accordingly. What I am looking for is an equivalent function for Linux, and I would prefer not to use any assembly to do this.
Anyone know of a library function for this?
try reading /proc/cpuinfo
Edit: might not work correctly with intel P4 cpus (HyperThreading seems to make the OS think that there are more physical cpus than there really are)
Ofcourse, treating a HT cpu as 2 cpus doesn't really hurt that much.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement