CPU
A central processing unit (CPU) is the electronic circuitry within a computer that carries out the instructions of a computer program by performing the basic arithmetic, logical, control and input/output (I/O) operations specified by the instructions.
CORE
A core is usually the basic computation unit of the CPU – it can run a single program context (or multiple ones if it supports hardware threads such as hyperthreading on Intel CPUs).
THREAD
A thread of execution is the smallest sequence of programmed instructions that can be managed independently by a scheduler, which is typically a part of the operating system.
Hyper-Threading
Hyper-Threading is a technology used by some Intel microprocessor s that allows a single microprocessor to act like two separate processors to the operating system
Quad-Core Octa-Core
mohammedrafi@NOC-RAFI:~$ lscpu
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 4
On-line CPU(s) list: 0-3
Thread(s) per core: 2
Core(s) per socket: 2
Socket(s): 1
NUMA node(s): 1
Vendor ID: GenuineIntel
CPU family: 6
Model: 42
Stepping: 7
CPU MHz: 930.761
BogoMIPS: 4988.78
Virtualization: VT-x
L1d cache: 32K
L1i cache: 32K
L2 cache: 256K
L3 cache: 3072K
NUMA node0 CPU(s): 0-3
################################
1)CPU(s): 4
2)Core(s) per socket: 2
3)Thread(s) per core: 2
4)Socket(s): 1
(No of Sockets) * (Core per socket) * (Theards per core) 1 * 2 * 2 = 4 threads
cpu =4; threads=4;So its not Hyper-Threading
If No of threads is double than the cpu’s then its “Hyper-Threading”
nproc command shows the number of processing units available:
mohammedrafi@NOC-RAFI:~$ nproc
4
mohammedrafi@NOC-RAFI:~$ cat /proc/cpuinfo |grep processor
processor : 0processor : 0processor : 1processor : 2processor : 3
################################
mohammedrafi@NOC-RAFI:~$ sudo dmidecode |grep -i cpu
Socket Designation: CPU 1 Version: Intel(R) Core(TM) i5-2450M CPU @ 2.50GHz
###################
In General i3 has 2 cores,4 threads it’s a “Hyper-Threading”
i5 has 4 cores,4 threads it’s a “Not Hyper-Threading”
i7 has 4 cores,8 threads it’s a “Hyper-Threading”
###################
mohammedrafi@NOC-RAFI:~$ lscpu | grep -i ‘socket’
Core(s) per socket: 2Socket(s): 1
CPUs = Threads per core X cores per socket X sockets
mohammedrafi@NOC-RAFI:~$ lscpu | egrep ‘^Thread|^Core|^Socket|^CPU\(‘
CPU(s): 4Thread(s) per core: 2Core(s) per socket: 2Socket(s): 1
mohammedrafi@NOC-RAFI:~$ egrep ‘processor|core id’ /proc/cpuinfo
processor : 0 core id : 0 processor : 1 core id : 0 processor : 2 core id : 1 processor : 3 core id : 1
mohammedrafi@NOC-RAFI:~$ grep -m 1 ‘cpu cores’ /proc/cpuinfo
cpu cores : 2
mohammedrafi@NOC-RAFI:~$ echo Cores = $(( $(lscpu | awk ‘/^Socket/{ print $2 }’) * $(lscpu | awk ‘/^Core/{ print $4 }’) ))
Cores = 2
mohammedrafi@NOC-RAFI:~$ sudo dmidecode -t 4 | egrep ‘Socket Designation|Count’
Socket Designation: CPU 1 Core Count: 2 Thread Count: 4
mohammedrafi@NOC-RAFI:~$ sudo dmidecode -t 4 | egrep -i “Designation|Intel|core|thread” Socket Designation: CPU 1 Family: Core i5 Manufacturer: Intel(R) Corporation HTT (Multi-threading) Version: Intel(R) Core(TM) i5-2450M CPU @ 2.50GHz Asset Tag: Intel(R) Genuine processor Core Count: 2 Core Enabled: 2 Thread Count: 4
mohammedrafi@NOC-RAFI:~$ sudo dmidecode | grep CPU Socket
Designation: CPU 1 Version: Intel(R) Core(TM) i5-2450M CPU @ 2.50GHz
mohammedrafi@NOC-RAFI:~$ sudo dmidecode | grep -i product Product
Name: HP ProBook 4430s Product Name: 167E
You need to be aware of sockets, cores and threadsYou need to be careful of the term CPU as it means different things in different contexts