Vincent Torri wrote:
> Hey,
> 
> I want to retrieve the number of active processors. I have found that 
> using sysconf(_SC_NPROCESSORS_ONLN) could do the trick, but i have read 
> somewhere 
> (http://forum.soft32.com/linux2/CPUs-machine-ftopict13343.html) that it 
> might not return the correct number of processors.
> 
> My question is, on Solaris, is it safe to use sysconf() ? Or is there a 
> better solution ?


sysconf works correctly on Solaris; keep in mind that the value returned
by _SC_NPROCESSORS_ONLN can change at any time due to processors being
brought on/off line, or on some platforms, added or removed
dynamically.

- Bart

-- 
Bart Smaalders                  Solaris Kernel Performance
barts at cyber.eng.sun.com              http://blogs.sun.com/barts
"You will contribute more with mercurial than with thunderbird."

Reply via email to