This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

how to get the number of CPUs?


I'm writing a multithread program to exploit power of CPUs on my Linux
machines. I'm intending to run it on several machines with other
number of CPUs on each of them. So I want to get the number of CPUs
dynamically at run time.

I've googled and learned about sysconf and getconf, but still dont
know will they help me and how to use them. Please help me!

Thank in advance.

Cong


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]