Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Developing U++ » U++ Developers corner » Anybody knows how to get number of CPU cores?
Re: Anybody knows how to get number of CPU cores? [message #10842 is a reply to message #10834] Wed, 01 August 2007 15:39 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 13984
Registered: November 2005
Ultimate Member
Thanks, it provided really useful hints:

For Win32, it seems like we can use GetProcessAffinityMask(GetCurrentProcess(), &pa, &sa);
and count the number of non-zero bits in sa.

For Linux, it is simply sysconf(_SC_NPROCESSORS_CONF); (or perhaps _SC_NPROCESSORS_ONLN).

BSD, MacOSX, anybody? Smile

Mirek
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: What improvements for Upp on Linux to comply with freedesktop?
Next Topic: The age of multicore has just started for U++....
Goto Forum:
  


Current Time: Wed Jun 05 09:57:03 CEST 2024

Total time taken to generate the page: 0.01292 seconds