Search the Community
Showing results for tags 'Processor Cores'.
-
_WinAPI_GetSystemInfo I needed to get the # of Processors for another project I have, so I was looking into MSDN to find the 'right' way to do it. I've actually stumbled upon a few ways, two are easy - the Environment variable %NUMBER_OF_PROCESSORS%, and also the Registry keys under "HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\CentralProcessor\" ('tip' has a nice simple function to get that info, _FasterCpuInfo()). Anyway, this API call seemed like it would be the best source, but this doesn't report on Hyperthreading ('fake') processors that are considered by the Operating System as individual processors. It turns out, the only 'easy' way to get Hyperthreading info is using the CPUID instruction, or to decipher the array returned by the 'GetLogicalProcessorInformation' API call - which only works with newer OS's. I have since written a function that was a port of Intel source code (mixed with Assembly) that actually worked on the processors we were able to test it on - but it's probably of limited use to most AutoIT programmers, so I'm not including it (for now) *edit: Fixed a structure descriptor that now allows this function to work correctly in x64 code. *edit 8/14/09: Fixed it to work correctly in 32-bit mode on an x64 O/S. (needs to call a different API function) Get the code at my site Ascend4nt's AutoIT Code License agreement: While I provide this source code freely, if you do use the code in your projects, all I ask is that: If you provide source, keep the header as I have put it, OR, if you expand it, then at least acknowledge me as the original author, and any other authors I creditIf the program is released, acknowledge me in your credits (it doesn't have to state which functions came from me, though again if the source is provided - see #1)The source on it's own (as opposed to part of a project) can not be posted unless a link to the page(s) where the code were retrieved from is provided and a message stating that the latest updates will be available on the page(s) linked to.Pieces of the code can however be discussed on the threads where Ascend4nt has posted the code without worrying about further linking.
- 82 replies
-
- System Info
- Hardware
-
(and 1 more)
Tagged with: