0

Modern CPU specifications seem to always mention twice the number of threads for each core. If it is a 4-core processor, the number of threads mentioned is 8. If it is a 6-core processor, the number of threads is 12.

At first, this felt confusing since, as far as I am aware, a single physical core can execute only a single thread at a time. Furthermore, any number of threads can be executed "simultaneously" with context switching. So, why even mention the number of threads in specifications?

Intel claims that this is possible in their processors due to Hyper-threading, which is their implementation of Simultaneous multithreading. I believe AMD has their own version.

Intel's explanation is that they expose each physical core as two "logical" cores. I am wondering how that improves performance. Why is it more efficient to execute two threads on two logical cores, rather than execute two threads on a single physical core with the help of context switching? The two logical cores are backed by a single physical core anyway. So, how is Simultaneous multithreading making a difference?

There seems to be some hardware implementations that make it more efficient. My vague understanding, after going through the wiki of Simultaneous multithreading, is that instructions from multiple threads are actually being executed at the same time. Apparently, that is the key difference. But, I do not understand why exposing one physical core as two logical cores is necessary. Is it to make the operating system serve more threads at the same time to the CPU? The operating system would think are twice the number of cores, and therefore serve twice the number of threads to the CPU. The OS will control the context switching, while the physical cores use their hardware capability to simultaneously execute the two threads served to each of them via their respective logical cores. Is that what happens?

Follow-up

A follow-up question would be, why not just specify them as logical cores in specifications? Why call them threads? For example:

Intel® Core™ i7-11600H Processor
# of Physical Cores 6
# of Logical Cores 12
Navin
  • 11
  • 4
  • 1
    Your "There seems to..." paragraph is pretty close to answering the main question. The processor is sharing resources at a finer-grained level than the OS or any software can do; instructions on threads A and B will both be in some stage of execution at the same time, and the processor holds context for both threads at once. And the "logical cores" way of thinking of it fits that into the model OSes already had for multiple CPUs/cores. – twotwotwo Jul 18 '21 at 18:25
  • What to call them in specs was, effectively, somebody's marketing decision! Cloud providers talk about "vCPUs". I find "threads" a little more honest: doubling "logical cores" or "vCPUs" with SMT might seem to an uninformed reader to double performance on highly-threaded applications, which it does not (the gains are maybe 30% on workloads where the processor-sharing helps a lot, and in other cases it can have little effect or even harm it). – twotwotwo Jul 18 '21 at 18:29
  • Personally, I find "threads" confusing or misleading. It is probably what led me to wondering about all this in the first place. If you take a look at Windows Task Manager, it lists them as "Logical processors", which is a better way to name them in my opinion. I do understand your point, though, about marketing. – Navin Jul 19 '21 at 01:44

0 Answers0