473,669 Members | 2,504 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 3813
AA
I found :)

System.Environm ent.GetEnvironm entVariable("NU MBER_OF_PROCESS ORS")
"AA" <aa@personal.ne t.py> wrote in message
news:Op******** ******@TK2MSFTN GP11.phx.gbl...
Do you know how can i get that?
Thanks a lot

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

System.Environm ent.GetEnvironm entVariable("NU MBER_OF_PROCESS ORS")

The result in my case is 1

But if you execute

Dim envVars As Collections.IDi ctionary =
System.Environm ent.GetEnvironm entVariables()
envVars.Item("N UMBER_OF_PROCES SORS") = 2
System.Environm ent.GetEnvironm entVariable("NU MBER_OF_PROCESS ORS")

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

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


"AA" <aa@personal.ne t.py> wrote in message
news:Op******** ******@TK2MSFTN GP11.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.ne t.py> wrote in message
news:%2******** ********@TK2MSF TNGP10.phx.gbl. ..
Bad news, EnironmentVaria bles is a collection and each entry can be modified So, if you execute this:

System.Environm ent.GetEnvironm entVariable("NU MBER_OF_PROCESS ORS")

The result in my case is 1

But if you execute

Dim envVars As Collections.IDi ctionary =
System.Environm ent.GetEnvironm entVariables()
envVars.Item("N UMBER_OF_PROCES SORS") = 2
System.Environm ent.GetEnvironm entVariable("NU MBER_OF_PROCESS ORS")

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

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


"AA" <aa@personal.ne t.py> wrote in message
news:Op******** ******@TK2MSFTN GP11.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_ComputerS ystem has a field NumberOfProcess ors.
"AA" <aa@personal.ne t.py> wrote in message
news:%2******** ********@TK2MSF TNGP10.phx.gbl. ..
Bad news, EnironmentVaria bles is a collection and each entry can be modified So, if you execute this:

System.Environm ent.GetEnvironm entVariable("NU MBER_OF_PROCESS ORS")

The result in my case is 1

But if you execute

Dim envVars As Collections.IDi ctionary =
System.Environm ent.GetEnvironm entVariables()
envVars.Item("N UMBER_OF_PROCES SORS") = 2
System.Environm ent.GetEnvironm entVariable("NU MBER_OF_PROCESS ORS")

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

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


"AA" <aa@personal.ne t.py> wrote in message
news:Op******** ******@TK2MSFTN GP11.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.ne t.py> wrote in message
news:%2******** ********@TK2MSF TNGP10.phx.gbl. ..
Bad news, EnironmentVaria bles is a collection and each entry can be modified So, if you execute this:

System.Environm ent.GetEnvironm entVariable("NU MBER_OF_PROCESS ORS")

The result in my case is 1

But if you execute

Dim envVars As Collections.IDi ctionary =
System.Environm ent.GetEnvironm entVariables()
envVars.Item("N UMBER_OF_PROCES SORS") = 2
System.Environm ent.GetEnvironm entVariable("NU MBER_OF_PROCESS ORS")

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

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


"AA" <aa@personal.ne t.py> wrote in message
news:Op******** ******@TK2MSFTN GP11.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_ComputerS ystem has a field NumberOfProcess ors.
"AA" <aa@personal.ne t.py> wrote in message
news:%2******** ********@TK2MSF TNGP10.phx.gbl. ..
Bad news, EnironmentVaria bles is a collection and each entry can be modified So, if you execute this:

System.Environm ent.GetEnvironm entVariable("NU MBER_OF_PROCESS ORS")

The result in my case is 1

But if you execute

Dim envVars As Collections.IDi ctionary =
System.Environm ent.GetEnvironm entVariables()
envVars.Item("N UMBER_OF_PROCES SORS") = 2
System.Environm ent.GetEnvironm entVariable("NU MBER_OF_PROCESS ORS")

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

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


"AA" <aa@personal.ne t.py> wrote in message
news:Op******** ******@TK2MSFTN GP11.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
2345
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 any api's for this , and also lemme know how exactly i can write the scannerapi for this, so that it can read the information of all the cpu's. I have the related CFG file for that. with regards thanks in advance
4
779
by: AA | last post by:
Do you know how can i get that? Thanks a lot
5
6868
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
2001
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 OS thinks it has four processors, but in reality, it has only two. I have updated the db2licm to use two processors, but want to be certain I did the right thing. Would it be possible to "pretend" that the machine does indeed have four processors...
9
7753
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 almost 100% usage of just one CPU and everything else is idle. (Overall CPU usages is less than 10%)
7
2124
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 drives. Small relations are on one EIDE drive, and the logfiles are on the other EIDE drive. When running the task, below, the rest of the machine is not doing much. I do not remember where I saw it, but somewhere I got the idea that the number...
2
1425
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 but if you know at least one, I'll appreciate your help When i said "portable" way, I mean that I need to run the same application in windows and linux and other .net capable system with the same behavior
1
9607
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 application, stress test shows that setting it to 2 gives a better performance result. In other words, web garden helps. My first question is if it helps to set a number larger than the number of processors in the server. Are they related at all? ...
0
940
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) There is a Runtime.getRuntime.availableProcessors() method that returns the number of available processors to the process. How do I do that in C# ? I think I have to use a Win32 unmanaged API call and can do that - but need some pointers on where I...
11
4912
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
8465
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
8895
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
8809
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
8588
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
8658
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7407
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
6210
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...
2
2032
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1788
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.