|
Posted by Andy Hassall on 07/19/07 16:56
On Thu, 19 Jul 2007 09:08:55 -0700, Shekar <shekariyer@gmail.com> wrote:
>Is there a class/module/function in PHP that will help me identify the
>number of CPUs on a system?
>php_uname() does not provide that information. Though I can execute a
>system command, I do not have a
>consistent method that will work across platforms like Linux, SunOS,
>AIX, HP-UX and Windows*
Not that I'm aware of, and I can't spot anything on PEAR - it's not the sort
of information you need very often. So you'll probably have to use php_uname
and then branch out to OS-specific methods (/proc/cpuinfo etc.)
You may also run into the definition of what is one CPU - multi-core and
hyperthreading cloud the issue, resulting in widely varying per-CPU licensing
terms for various commmercial products. Is this what you want the information
for?
--
Andy Hassall :: andy@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
[Back to original message]
|