Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Detect HyperThreading
Message
From
31/03/2011 02:17:27
 
 
To
30/03/2011 21:55:42
Joel Leach
Memorial Business Systems, Inc.
Tennessee, United States
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
01505630
Message ID:
01505645
Views:
80
>I wrote a program to detect HyperThreading (HT) using WMI. Would you mind testing on your machine(s)? It only works on Windows XP SP3, Windows Server 2003, and later, because that is when MS introduced the required APIs. Other than that, the only requirement is that you actually know whether or not your hardware supports HT. I would like this tested on machines that have HT and those that don't, but please report which you have with your results. Thanks! I appreciate the help.
>
>
>* Use WMI to determine if HyperThreading is turned on
>* This only works on Windows XP SP3, Windows Server 2003, and later because
>*	underlying Windows APIs were not added until those versions.
>Local lcWMIFolder, loWMI, lcolProcessors, loProcessor
>
>lcWMIFolder = Addbs(GetEnv("SystemRoot")) + "System32\WBEM\"
>If Directory(lcWMIFolder)	&& make sure installed
>	loWMI = GetObject("winmgmts:\\.\root\cimv2")
>	lcolProcessors = loWMI.ExecQuery("Select * from Win32_Processor")
>	For each loProcessor in lcolProcessors FoxObject
>		If Type("loProcessor.NumberOfCores")<> "U" and Type("loProcessor.NumberOfLogicalProcessors")<> "U"
>			? "CPU Manufacturer:", loProcessor.Manufacturer
>			? "CPU Name:", loProcessor.Name
>			? "Number of Physical Cores:", loProcessor.NumberOfCores
>			? "Number of Logical Processors:", loProcessor.NumberOfLogicalProcessors
>			* If logical processors > actual cores, HT must be turned on
>			If loProcessor.NumberOfLogicalProcessors > loProcessor.NumberOfCores
>				? "HyperThreading is ENABLED"
>			Else
>				? "HyperThreading is DISABLED or unavailable on CPU"
>			EndIf 
>		Else
>			? "HyperThreading detection not available on this O/S"
>		EndIf 
>	EndFor 
>Else
>	? "WMI is not installed."
>EndIf 
>
Here's what I got from GoDaddy:

CPU Manufacturer:GenuineIntel
CPU Name:Intel(R) Xeon(R) CPU L5506 @ 2.13GHz
Number of Physical Cores:4
Number of Logical Processors:4
HyperThreading is DISABLED or unavailable on CPU
CPU Manufacturer:GenuineIntel
CPU Name:Intel(R) Xeon(R) CPU L5506 @ 2.13GHz
Number of Physical Cores:4
Number of Logical Processors:4
HyperThreading is DISABLED or unavailable on CPU

which I guess means 2 processors each with 4 cores but no hyperthreading. Powerful machine nonetheless. Can anybody beat it?
Previous
Reply
Map
View

Click here to load this message in the networking platform