---------- Forwarded message ---------- From: Vincent Torri <vincent.to...@gmail.com> Date: Fri, Aug 7, 2009 at 8:38 PM Subject: Re: [tools-compilers] getting number of processors To: Bart Smaalders <bart.smaalders at sun.com>
On Fri, Aug 7, 2009 at 7:11 PM, Bart Smaalders <bart.smaalders at sun.com>wrote: > 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. that's what i've read, though i don't know that kind of system (i have a linux box, i just try to make Enlightenment working on opensolaris) anyway, thank you for your answer ! Vincent Torri -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.opensolaris.org/pipermail/tools-compilers/attachments/20090807/e9464675/attachment.html>