How to get number of threads?
Posted: Mon Feb 25, 2013 12:00 pm
I want to get thread number. Which CPUID function gives me that number? I'm talking about Intel CPUs. I tried to get it by standard function EAX=1, reg EBX bits [23:16]. But some CPUs shows me that number of threads is 16. In Intel manual i found that this field is:
Bits 23-16: Maximum number of addressable IDs for logical processors
in this physical package*.
* The nearest power-of-2 integer that is not smaller than EBX[23:16]
is the number of unique initial APIC IDs reserved for addressing different
logical processors in a physical package. This field is only valid
if CPUID.1.EDX.HTT[bit 28]= 1.
So this is a not the number of threads? It is the number of addressable identyfiers for threads, right? So where i find this number?
Below are the results of my CPUID program.
---------------------------------------------------------------------
Vendor ID : GenuineIntel
Processor name : Intel(R) Core(TM) i5-3570 CPU @ 3.40GHz
Processor type : 1
0 - N/A
1 - OEM
2 - OverDrive
3 - Dual
Stepping ID : 09
Model : 10
Family Code : 06
Extended Model : 03
Extended Family: 000
Brand Index : 00
Threads/CPU : 16 ;!!! this is what i'm talking about
Default APIC ID: 04
CLFLUSH size : 00064 bytes
Largest CPUID standard function: 13
Largest CPUID extended function: 08
EAX = 000306A9 ;regs after CPUID EAX = 1
EBX = 04100800
ECX = 7FBAE3FF
EDX = BFEBFBFF
----------------------------------------------------------------------
Vendor ID : GenuineIntel
Processor name : Intel(R) Core(TM) i5-2450M CPU @ 2.50GHz
Processor type : 1
0 - N/A
1 - OEM
2 - OverDrive
3 - Dual
Stepping ID : 07
Model : 10
Family Code : 06
Extended Model : 02
Extended Family: 000
Brand Index : 00
Threads/CPU : 16 ;!!! this is what i'm talking about
Default APIC ID: 02
CLFLUSH size : 00064 bytes
Largest CPUID standard function: 13
Largest CPUID extended function: 08
EAX = 000206A7 ;regs after CPUID EAX = 1
EBX = 02100800
ECX = 1FBAE3BF
EDX = BFEBFBFF
-------------------------------------------------------------------------
thanks in advance
Bits 23-16: Maximum number of addressable IDs for logical processors
in this physical package*.
* The nearest power-of-2 integer that is not smaller than EBX[23:16]
is the number of unique initial APIC IDs reserved for addressing different
logical processors in a physical package. This field is only valid
if CPUID.1.EDX.HTT[bit 28]= 1.
So this is a not the number of threads? It is the number of addressable identyfiers for threads, right? So where i find this number?
Below are the results of my CPUID program.
---------------------------------------------------------------------
Vendor ID : GenuineIntel
Processor name : Intel(R) Core(TM) i5-3570 CPU @ 3.40GHz
Processor type : 1
0 - N/A
1 - OEM
2 - OverDrive
3 - Dual
Stepping ID : 09
Model : 10
Family Code : 06
Extended Model : 03
Extended Family: 000
Brand Index : 00
Threads/CPU : 16 ;!!! this is what i'm talking about
Default APIC ID: 04
CLFLUSH size : 00064 bytes
Largest CPUID standard function: 13
Largest CPUID extended function: 08
EAX = 000306A9 ;regs after CPUID EAX = 1
EBX = 04100800
ECX = 7FBAE3FF
EDX = BFEBFBFF
----------------------------------------------------------------------
Vendor ID : GenuineIntel
Processor name : Intel(R) Core(TM) i5-2450M CPU @ 2.50GHz
Processor type : 1
0 - N/A
1 - OEM
2 - OverDrive
3 - Dual
Stepping ID : 07
Model : 10
Family Code : 06
Extended Model : 02
Extended Family: 000
Brand Index : 00
Threads/CPU : 16 ;!!! this is what i'm talking about
Default APIC ID: 02
CLFLUSH size : 00064 bytes
Largest CPUID standard function: 13
Largest CPUID extended function: 08
EAX = 000206A7 ;regs after CPUID EAX = 1
EBX = 02100800
ECX = 1FBAE3BF
EDX = BFEBFBFF
-------------------------------------------------------------------------
thanks in advance