How do I retrieve the number of processors on C / Linux ?

Posted by Andrei Ciobanu on Stack Overflow See other posts from Stack Overflow or by Andrei Ciobanu
Published on 2010-04-22T19:48:31Z Indexed on 2010/04/23 3:03 UTC
Read the original article Hit count: 273

Filed under:
|
|

I am writing a small C application that use some threads for processing data. I want to be able to know the number of processors on a certain machine, without using system() & in combination to a small script.

The only way i can think of is to parse /proc/cpuinfo. Any other useful suggestions ?

© Stack Overflow or respective owner

Related posts about c

    Related posts about posix