14

enter image description here

As the image shows number of processors are 4.

But intel i5-4210U has only 2 cores as shown below. (Intel's own specs.)

enter image description here

So, if i5-4210U has only 2 cores than what is "4" indicating in the 1st pic?

lscpu gives this result:

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:                 69
Stepping:              1
CPU MHz:               989.531
BogoMIPS:              4788.74
Virtualization:        VT-x
L1d cache:             32K
L1i cache:             32K
L2 cache:              256K
L3 cache:              3072K
NUMA node0 CPU(s):     0-3
  • 10
    Because it has Hyperthreading, which means that the CPU presents four cores to the OS, instead of only the two physical ones, in order to improve performance. ("# of threads" from the spec sheet is what the CPU info in Ubuntu is showing you) – JonasCz Aug 3 '16 at 11:16
  • 3
    The other way of finding this out is to do lscpu and look at CPU(s), Thread(s) per core and Core(s) per socket and Socket(s). – edwinksl Aug 3 '16 at 11:18
  • @edwinksl , added result of lscpu. – foxtrot9 Aug 3 '16 at 11:23
  • 2
    So you have 4 "CPUs" aka logical cores, 2 threads per physical core (this is the hyperthreading part), 2 physical cores per socket and 1 socket. 4 = 2*2*1. – edwinksl Aug 3 '16 at 11:27
  • you didn't hear hyperthreading which exists since pentium 4? – phuclv Aug 4 '16 at 7:54
31

Your CPU has only 2 cores, but supports 4 concurrent threads.

This is achieved by Intel's Hyper-Threading technology that allows to run two separate threads in parallel at the same time on one single core.

So 2 cores x 2 threads per core means 4 threads per CPU.

  • 1
    I know little bit about threads so I am curious how this can be achieved at hardware level? I mean 2 threads per CPU? – foxtrot9 Aug 3 '16 at 11:19
  • 7
    I can't really start explaining the whole concept behind hyper threading here, this would blow up the answer. Instead I would like to suggest you to read the corresponding wikipedia article or feed your favourite search engine with "hyperthreading". – Byte Commander Aug 3 '16 at 11:28
  • 6
    In short, we can say that a hyperthreading-capable core has some elements (architectural state i.e. the registers etc) duplicated while others (execution engine, cache) are shared. – Byte Commander Aug 3 '16 at 11:32
  • 5
    @foxtrot9 basically, a single thread of execution usually doesn't use anywhere near 100% of a CPU core — the CPU spends time waiting for data to load from memory, and any given instruction doesn't use all of the little circuits (execution units) in the core that do various things. HT lets two threads of execution share the core, so one can run while the other is waiting, or they both can run if they use disjoint sets of execution units. But because the two threads have to share resources, sometimes one stops the other from running, so it's not as fast as 2 whole cores. – hobbs Aug 3 '16 at 15:55
  • @hobbs Detailed but simple explanation, great! Thanks for this informative comment :) – Byte Commander Aug 3 '16 at 16:15
3

As you can see in the image you provided from Intel, the number of Threads is 4.

So I would say that Ubuntu is showing the number of Threads and not of the Cores

1

In i5-4210 processor of Intel there are 2 physical cores which are further split into 2 logical cores; these logical cores are achieved by Intel's hyper threading technology. Thus making it a total of 4 cores as shown in the pic. This info is also given in the other pic.

  • I don't know why people are downvoting your answer, what you've said is true. – Virtual Anomaly Aug 4 '16 at 9:56
  • People are dumb then, I don't mind. – Moksh Aug 4 '16 at 9:58
  • Just to back up this answer, Wikipedia says: "For each processor core that is physically present, the operating system addresses two virtual (logical) cores." – Virtual Anomaly Aug 4 '16 at 10:00
  • Thnx @lightswitchr – Moksh Aug 4 '16 at 10:01
  • 1
    I think people are downvoting because you said that there are two physical cores and two logical cores. That's not true, each physical core is split into two logical cores, so there are four logical cores (two running on each physical core). – Runemoro Aug 4 '16 at 12:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.