473,795 Members | 2,830 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 3461
On Thu, 19 Jul 2007 09:08:55 -0700, Shekar <sh********@gma il.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.u k :: 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********@gma il.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
2826
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 significant bits. The leftmost bit is used for the sign, as usual. With 8 bits for each number, add -4 and -6, using 4 bit binary 2's complement arithmetic. Did over-flow occur ? Did carry occur ? Verify your numerical result.
1
3383
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 = conn.CreateCommand(); cmd.CommandText = "SELECT * FROM Customer"; SqlCeResultSet rs = cmd.ExecuteResultSet(ResultSetOptions.Scrollable); dgrData.DataSource = rs; //dgrData is DataTable
4
1733
by: savitabca | last post by:
how to write a code to reverse an number without using % and /
2
2505
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
1828
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
3696
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 = e.keyCode if(((strkeyIE >= 48) && (strkeyIE <= 57 )) || (strkeyIE >= 40) && (strkeyIE <= 41 ) || (strkeyIE == 32) || (strkeyIE == 46)||(strkeyIE
4
4592
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 write it using "complex.h", other than using own data structures? #include <stdio.h> #include <complex.h>
0
9673
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9522
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10443
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10216
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10165
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9044
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7543
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6783
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5565
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.