473,321 Members | 1,916 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,321 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 3789
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: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.