Цитата SmallGod:
На сколько я знаю в XP SP3 тоже есть. »
|
Спасибо. Действительно так:
читать дальше »
Код:

wmic path Win32_Processor get NumberOfLogicalProcessors,NumberOfCores
NumberOfCores NumberOfLogicalProcessors
2 2
Код:

wmic computersystem get NumberOfProcessors,NumberOfLogicalProcessors
NumberOfLogicalProcessors NumberOfProcessors
2 1
Что касается конкретно Windows XP, то судя по KB936235:
The number of physical hyperthreading-enabled processors or the number of physical multicore processors is incorrectly reported in Windows XP, включённому в SP3:
Список исправлений, включенных в Windows XP с пакетом обновления 3, эти свойства действительно появились в SP3/SP2+KB936235:
читать дальше »
Цитата KB936235:
…
Before you apply this hotfix, the WMI classes and the WMI properties exhibit the following behavior.
Win32_ComputerSystem
* The NumberOfProcessors property returns the number of logical processors that are available on the system.
* The NumberOfLogicalProcessors property is not available.
Win32_Processor
* The NumberOfLogicalProcessors property is not available.
* The NumberOfCores property is not available.
* The number of Win32_Processor instances that are returned is equal to the number of logical processors that are available on the system.
After you apply this hotfix, the WMI classes and the WMI properties exhibit the following behavior.
Win32_ComputerSystem
* The NumberOfProcessors property returns the number of physical processors that are available on the system.
* The NumberOfLogicalProcessors property returns the number of logical processors that are available on the system.
Win32_Processor
* The NumberOfLogicalProcessors property returns the number of logical processors on the current instance.
* The NumberOfCores property returns the number of cores on the current instance.
* The number of Win32_Processor instances that are returned is equal to the number of physical processors that are available on the system.
To determine whether hyperthreading is enabled for the processor, compare the value of the NumberOfCores property to the value of the NumberOfLogicalProcessors property. If hyperthreading is enabled in the basic input/output system (BIOS) for the processor, the value of the NumberOfCores property is less than the value of the NumberOfLogicalProcessors property.
For example, assume that a dual-processor system contains two processors that are each enabled for hyperthreading. This system can run four threads or four programs at the same time. In this case, the value of the NumberOfCores property is 2, and the value of the NumberOfLogicalProcessors property is 4.
|
Возможно, есть аналогичный же HotFix и под «Windows Server 2003»?!
Добавлено: ага, вот и аналогичная же статья, KB932370:
The number of physical hyperthreading-enabled processors or the number of physical multicore processors is incorrectly reported in Windows Server 2003.
Что касается «System.Environment.ProcessorCount» aka «%NUMBER_OF_PROCESSORS%», то опять же, речь идёт, скорее, о логических процессорах:
Код:

set num
NUMBER_OF_PROCESSORS=2
Впрочем, я не представляю, где реально можно посмотреть на машину с XP на многопроцессорной машине. Разве что попробовать проделать сию установку специально.
P.S. Все вышеприведённые примеры — для «Windows XP SP3».