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

Number of CPUs

Hi

When measuring the thread pool with ThreadPool.GetMaxThreads(..), it returns
25 threads per CPU. On a hyper threaded machine, though, it returns 50
threads, still only having one CPU. How do I accurately determine the
physical CPU count? Any idea?

Thanks, Urs
Nov 17 '05 #1
5 6903


Urs Vogel wrote:
threads, still only having one CPU. How do I accurately determine the
physical CPU count? Any idea?


I would guess WMI would be the route to take, but more importantly, how
come you need to know the physical CPU-count?

Note that "physical cpu-count" has been a rather vague term for quite a
while now. All recent CPU's have multiple, concurrent computational units.

--
Helge Jensen
mailto:he**********@slog.dk
sip:he**********@slog.dk
-=> Sebastian cover-music: http://ungdomshus.nu <=-
Nov 17 '05 #2
Thanks Helge

I need it for licensing purposes for an application server. Hyper threaded
CPUs must still count as ONE CPU.

Urs

"Helge Jensen" <he**********@slog.dk> schrieb im Newsbeitrag
news:42**************@slog.dk...


Urs Vogel wrote:
threads, still only having one CPU. How do I accurately determine the
physical CPU count? Any idea?


I would guess WMI would be the route to take, but more importantly, how
come you need to know the physical CPU-count?

Note that "physical cpu-count" has been a rather vague term for quite a
while now. All recent CPU's have multiple, concurrent computational units.

--
Helge Jensen
mailto:he**********@slog.dk
sip:he**********@slog.dk
-=> Sebastian cover-music: http://ungdomshus.nu <=-

Nov 17 '05 #3

"Urs Vogel" <uv****@msn.com> wrote in message
news:%2******************@TK2MSFTNGP09.phx.gbl...
Hi

When measuring the thread pool with ThreadPool.GetMaxThreads(..), it
returns 25 threads per CPU. On a hyper threaded machine, though, it
returns 50 threads, still only having one CPU. How do I accurately
determine the physical CPU count? Any idea?

Thanks, Urs


Read the NUMBER_OF_PROCESSORS environment variable, or use System.Management
and the WMI class Win32_processor.
Note that each core (logical CPU) is treated as a separate CPU by the OS, so
the value returned by GetMaxThreads is valid as far as the CLR is concerned.

Willy.
Nov 17 '05 #4
I would not rely on any formula involving the maximum threads per processor
for the simple reason that this value can change with some future build of
the framework. In any case, WMI or some Win32 call surely exists for
determining that. Try Googling on:

"determine number of processors" windows

.... or similar.

--Bob

"Urs Vogel" <uv****@msn.com> wrote in message
news:%2******************@TK2MSFTNGP09.phx.gbl...
Hi

When measuring the thread pool with ThreadPool.GetMaxThreads(..), it
returns 25 threads per CPU. On a hyper threaded machine, though, it
returns 50 threads, still only having one CPU. How do I accurately
determine the physical CPU count? Any idea?

Thanks, Urs

Nov 17 '05 #5
Bob

found the following, looks rigth into the CPU(s), checks for Hyperthreading
and even retrieves the logical and physical CPU IDs:

http://www.intel.com/cd/ids/develope...base/43838.htm

Thanks. Urs

"Bob Grommes" <bo*@bobgrommes.com> schrieb im Newsbeitrag
news:O1**************@tk2msftngp13.phx.gbl...
I would not rely on any formula involving the maximum threads per processor
for the simple reason that this value can change with some future build of
the framework. In any case, WMI or some Win32 call surely exists for
determining that. Try Googling on:

"determine number of processors" windows

... or similar.

--Bob

"Urs Vogel" <uv****@msn.com> wrote in message
news:%2******************@TK2MSFTNGP09.phx.gbl...
Hi

When measuring the thread pool with ThreadPool.GetMaxThreads(..), it
returns 25 threads per CPU. On a hyper threaded machine, though, it
returns 50 threads, still only having one CPU. How do I accurately
determine the physical CPU count? Any idea?

Thanks, Urs


Nov 17 '05 #6

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

Similar topics

1
by: Canneloni | last post by:
Xeon hyperthreaded CPUs show up as two CPUs in the cpuinfo file. So a dual Xeon machine appears as a quad processor. In Windows, it's the same thing. A dual Xeon will have 4 CPU charts...
1
by: AWHK | last post by:
I got 4 virtual CPUs on my computer (xeon processor) and I got this .NET application that runs a lengthy processor intensive task. I have noticed when I start two instances of the application (each...
1
by: Shreyas Kulkarni | last post by:
hi there, recently i have got a problem regarding calculation of sum of digits in a floating point or precision number. the weird behaviour of compiler/language is preventing me from calculating...
1
by: RP | last post by:
Hi all, where can I find some docs on tuning asp.net 1.1 for HT CPUs? We just upgraded our server to a single HT CPU and it appears that the OS still reports 2 CPUs? TIA!
3
by: adsheehan | last post by:
I have been reading many of the posting on the GIL and impact on threading etc. I have found is confusing and would welcome some clarity on this. I understand that embedding the interpreter in a...
4
by: Klaas Vantournhout | last post by:
Hi, I am currently using OpenMP (gcc 4.2.0) to do parallel computing on a computer with a certain amount of cpu's. I need the total number of cpu's as a variable in my code. So I was...
1
by: rcamarda | last post by:
I have been unsuccessful locating information about the maximum number of CPU's SQL Server 2005 Enterprise supports. However I did find info in a document about configuring a fail over cluster...
3
by: Shekar | last post by:
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...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
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
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
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,...
0
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...

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.