This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
how to get the number of CPUs?
- From: Cong <vo dot chi dot cong at is dot titech dot ac dot jp>
- To: gcc-help at gcc dot gnu dot org
- Date: Thu, 04 Jul 2002 20:45:51 +0900 (JST)
- Subject: how to get the number of CPUs?
- References: <1025766825.11142.ezmlm@gcc.gnu.org>
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