473,395 Members | 1,578 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Number of CPUs using PHP?

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*

Thanks
Shekar

Jul 19 '07 #1
3 3438
On Thu, 19 Jul 2007 09:08:55 -0700, Shekar <sh********@gmail.comwrote:
>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 :: an**@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
Jul 19 '07 #2
I want to find the number of CPUs to guage the capacity of the system
and spawn
parallel executions to maximize CPU usage. Thanks anyway.

Jul 23 '07 #3
Shekar <sh********@gmail.comwrote:
>I want to find the number of CPUs to guage the capacity of the system
and spawn parallel executions to maximize CPU usage.
Interesting. How would you expect to do that in PHP?
--
Tim Roberts, ti**@probo.com
Providenza & Boekelheide, Inc.
Jul 24 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: c2h | last post by:
The question is : Consider a machine that perform calculation 4 bits a time. 8 bits 2's complement numbers can be added by adding the four least significant bits, followed by the four most...
1
by: uveper | last post by:
Does anybody know how to get a number of rows when using DataTable with datasource that is an SqlCeResultSet. I use the following code to "select" the data into DataTable: SqlCeCommand cmd =...
4
by: savitabca | last post by:
how to write a code to reverse an number without using % and /
2
by: sudankanakavel | last post by:
i need a random prime number generator which will generate prime numbers for given range for eg 22222 to 99999 operating system : windows language : java
1
by: vingomail | last post by:
Hi friends.. I need a javascript function to validate a number or character for textbox in asp.net Please help me
5
by: Abhishek | last post by:
Hi this is my another validator in javascript to validate the Phone Number :-) <script language='javascript'> function funcCheckPhoneNumber(ctrtxtMobile,e){ if(window.event){ var strkeyIE =...
4
by: Reshmi | last post by:
Hi, I have this C code which does complex number arithmetic. When I try to write a similar file for C++, it says that "creal’ was not declared in this scope". Can anyone give a better idea to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.