Home > Back-end >  About the Windows API function GetSystemInfo capture the CPU logic auditing (threads) no problem
About the Windows API function GetSystemInfo capture the CPU logic auditing (threads) no problem

Time:11-18

Before I came to use GetSystemInfo get CPU logic auditing, environment: Windows 7 x64; Two physical CPU; Each CPU is 16 nuclear;
Use GetSystemInfo to obtain nuclear dwNumberOfProcessors=32 CPU logic, is the total logic of two physical CPU auditing;
On a new computer now, still use GetSystemInfo found that only access to the logic of a CPU auditing; The new computer environment: win10 x64; Two physical CPU; Each CPU is 48 nuclear; Use GetSystemInfo access to CPU logic auditing dwNumberOfProcessors=48, is a physical CPU logic auditing; Why not 96? Great god help explain please, thank!
Attach the use GetSystemInfo access to CPU logic auditing procedures:
SYSTEM_INFO sys.
GetSystemInfo (& amp; Sys);
Int num=0;
Num=sys. DwNumberOfProcessors;

CodePudding user response:

Speculation is for this reason: your 32-bit application running on WOW64, GetNativeSystemInfo try

To retrieve accurate information for an application running on WOW64, call the GetNativeSystemInfo function.

CodePudding user response:

GetLogicalProcessorInformationEx

CodePudding user response:

reference 1st floor Chen Zhongfu response:
speculation is for this reason: your 32-bit application running on WOW64, GetNativeSystemInfo try

To retrieve accurate information for an application running on WOW64, call the GetNativeSystemInfo function.

Hello, my program is 64, and the system

CodePudding user response:

refer to the second floor early play big play nuclear response:
GetLogicalProcessorInformationEx

Hello, can you explain it specifically? Don't know much about this aspect of the content

CodePudding user response:

https://stackoverflow.com/questions/41486106/trying-to-get-the-active-cores-confused-with-the-usage-of-getlogicalprocessorinf

CodePudding user response:

STD: : thread: : hardware_concurrency ();
Try this line not line
  • Related