473,398 Members | 2,088 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,398 software developers and data experts.

how to get the number of processors available?

AA
Do you know how can i get that?
Thanks a lot
Nov 22 '05 #1
6 3792
AA
I found :)

System.Environment.GetEnvironmentVariable("NUMBER_ OF_PROCESSORS")
"AA" <aa@personal.net.py> wrote in message
news:Op**************@TK2MSFTNGP11.phx.gbl...
Do you know how can i get that?
Thanks a lot

Nov 22 '05 #2
AA
Bad news, EnironmentVariables is a collection and each entry can be modified
So, if you execute this:

System.Environment.GetEnvironmentVariable("NUMBER_ OF_PROCESSORS")

The result in my case is 1

But if you execute

Dim envVars As Collections.IDictionary =
System.Environment.GetEnvironmentVariables()
envVars.Item("NUMBER_OF_PROCESSORS") = 2
System.Environment.GetEnvironmentVariable("NUMBER_ OF_PROCESSORS")

now the result is 2
So, is possible to get the REAL number of processors?

In a "license per processor" the GetEnvironmentVariable() would be not
useful.
Thanks


"AA" <aa@personal.net.py> wrote in message
news:Op**************@TK2MSFTNGP11.phx.gbl...
Do you know how can i get that?
Thanks a lot

Nov 22 '05 #3
SFB
Absent a mechanism that forces concurrent execution of multiple threads on
multiple processors, it is just a number.

"AA" <aa@personal.net.py> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
Bad news, EnironmentVariables is a collection and each entry can be modified So, if you execute this:

System.Environment.GetEnvironmentVariable("NUMBER_ OF_PROCESSORS")

The result in my case is 1

But if you execute

Dim envVars As Collections.IDictionary =
System.Environment.GetEnvironmentVariables()
envVars.Item("NUMBER_OF_PROCESSORS") = 2
System.Environment.GetEnvironmentVariable("NUMBER_ OF_PROCESSORS")

now the result is 2
So, is possible to get the REAL number of processors?

In a "license per processor" the GetEnvironmentVariable() would be not
useful.
Thanks


"AA" <aa@personal.net.py> wrote in message
news:Op**************@TK2MSFTNGP11.phx.gbl...
Do you know how can i get that?
Thanks a lot


Nov 22 '05 #4
Another possibility is to use WMI. The WMI
class Win32_ComputerSystem has a field NumberOfProcessors.
"AA" <aa@personal.net.py> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
Bad news, EnironmentVariables is a collection and each entry can be modified So, if you execute this:

System.Environment.GetEnvironmentVariable("NUMBER_ OF_PROCESSORS")

The result in my case is 1

But if you execute

Dim envVars As Collections.IDictionary =
System.Environment.GetEnvironmentVariables()
envVars.Item("NUMBER_OF_PROCESSORS") = 2
System.Environment.GetEnvironmentVariable("NUMBER_ OF_PROCESSORS")

now the result is 2
So, is possible to get the REAL number of processors?

In a "license per processor" the GetEnvironmentVariable() would be not
useful.
Thanks


"AA" <aa@personal.net.py> wrote in message
news:Op**************@TK2MSFTNGP11.phx.gbl...
Do you know how can i get that?
Thanks a lot


Nov 22 '05 #5
SFB
Absent a mechanism that forces concurrent execution of multiple threads on
multiple processors, it is just a number.

"AA" <aa@personal.net.py> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
Bad news, EnironmentVariables is a collection and each entry can be modified So, if you execute this:

System.Environment.GetEnvironmentVariable("NUMBER_ OF_PROCESSORS")

The result in my case is 1

But if you execute

Dim envVars As Collections.IDictionary =
System.Environment.GetEnvironmentVariables()
envVars.Item("NUMBER_OF_PROCESSORS") = 2
System.Environment.GetEnvironmentVariable("NUMBER_ OF_PROCESSORS")

now the result is 2
So, is possible to get the REAL number of processors?

In a "license per processor" the GetEnvironmentVariable() would be not
useful.
Thanks


"AA" <aa@personal.net.py> wrote in message
news:Op**************@TK2MSFTNGP11.phx.gbl...
Do you know how can i get that?
Thanks a lot


Nov 22 '05 #6
Another possibility is to use WMI. The WMI
class Win32_ComputerSystem has a field NumberOfProcessors.
"AA" <aa@personal.net.py> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
Bad news, EnironmentVariables is a collection and each entry can be modified So, if you execute this:

System.Environment.GetEnvironmentVariable("NUMBER_ OF_PROCESSORS")

The result in my case is 1

But if you execute

Dim envVars As Collections.IDictionary =
System.Environment.GetEnvironmentVariables()
envVars.Item("NUMBER_OF_PROCESSORS") = 2
System.Environment.GetEnvironmentVariable("NUMBER_ OF_PROCESSORS")

now the result is 2
So, is possible to get the REAL number of processors?

In a "license per processor" the GetEnvironmentVariable() would be not
useful.
Thanks


"AA" <aa@personal.net.py> wrote in message
news:Op**************@TK2MSFTNGP11.phx.gbl...
Do you know how can i get that?
Thanks a lot


Nov 22 '05 #7

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

Similar topics

2
by: muttu | last post by:
hello everybody am writing a scanner using python which has to get the information for sun's dual processors, so could any one of you please tell me how to find the number of processors . is there...
4
by: AA | last post by:
Do you know how can i get that? Thanks a lot
5
by: PaulThomas | last post by:
Using VS.Net 2000 and C# How can I get the CPU Serial Number and the Operating Syatem Serial Number Thanks in advance, Paul
2
by: mairhtin o'feannag | last post by:
Hello, I am a bit confused as to how this all works with respect to number of processors on a Linux machine. The situation I am encountering is this : because of Hyperthreading technology, the...
9
by: db2inst2 | last post by:
Hi all, I have DB28.2 running on win2003 system which has 8 Processors with HT its 16 How do i make DB2 more use of all the processors? Right now i am doing an import and task manager shows...
7
by: Jean-David Beyer | last post by:
I have six hard drives (4 SCSI and 2 EIDE) on my main machine with parts of a database on each drive. The main index is on one SCSI drive all to itself. The main data are on the other three SCSI...
2
by: AA | last post by:
Somebody know a "portable" way to get the mac address and the number of availables processors of the computer where the .net application is running? I know that both are very different questions...
1
by: Dominic | last post by:
I'd like to tune the performance of my application in a web garden. Our server has dual processors. Is there any guideline to set this "maximum number of worker processes" for web garden? In my...
0
by: Sam | last post by:
I m trying to port a a Java app to C# and have two questions. i) In Java there is a java.util.Logging package that can be used to log at different levels. Is there an equivalent in C# ? 2)...
11
by: John | last post by:
Is there a way to find the number of processors on a machine (on linux/ windows/macos/cygwin) using python code (using the same code/cross platform code)?
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...
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
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.