IF (CPUID(1).EBX[23:16] > 1)
is exactly what you are returning by this line
$iLogicalProcessorCount = BitAND(BitShift($iEBX, 16), 0xFF) ; 16-23
in your ASM example here. Returns 4 for all cores on my machine... re-reading the spec above it says "Hyper-Threading Technology or Core Multi-Processing (CMP) has been enabled", so 4 is a valid return. It's not possible to determine if the returned number of processor are full cores or HT-enabled ones by this means either... *sigh*, read also that it's best to let the OS handle the affinity, else you're only going to screw performance anyhow, but at this point I just see this as a pure hypothetical challenge
Edit #1: Hey, Ascend4nt, you stole my 'Arrrgh'
Edit #2: Seems we're after slightly different things, a ) determine if a core is a 'Full' core and b ) how many physical processors are there on the mobo...
Edited by KaFu, 10 July 2009 - 01:59 PM.






