1

I read that the multithreading is the feature that a single core can manage many threads (not in parallel) and the benefit is that the CPU is always working. For the Hyperthreading that a single core create 2 Virtual Cores and take 2 Threads for each physical core and the benefit is the same as the Multithreading.

Why many says that the Hyperthreading is better than Multithreading?

Does the Ryzen CPU use Hyperthreading or Multithreading?

Peter Cordes
  • 328,167
  • 45
  • 605
  • 847

1 Answers1

3

Hyperthreading is Intel's marketing name for SMT aka Simultaneous Multithreading - one physical core presenting itself as multiple logical cores, to help keep hungry execution units fed with work, especially for code that tends to stall or have other throughput bottlenecks (like dependency chains). See http://www.lighterra.com/papers/modernmicroprocessors/ for background info about modern CPU pipelines.

(In some CPUs, especially i5 series, Intel disables this feature for market-segmentation reasons. And the efficiency cores in Alder Lake don't support SMT at all, only the P-cores, so some chips have a logical core count that's not 1x or 2x the physical core count.)

AMD Zen also uses SMT in essentially the same way as current Intel CPUs, unlike Bulldozer-family. Wikichip's Zen article has an SMT section which describes some of the CPU architecture implementation details, like which structures are partitioned (split in half when both logical cores are active, not sleeping) vs. replicated vs. competitively shared.

See David Kanter's deep-dive into Bulldozer for some details about its CMT - "Clustered Multi-Threading", which is what AMD called their design of having two weak integer back-ends sharing a SIMD/FP unit and some resources. It had the major downside of not being able to run a single thread fast, only two threads with somewhat good total throughput. (Compared to Bulldozer's generally lowish performance, thanks to that and some other design decisions which AMD wisely scrapped for Zen, after having the chance to see how they panned out over the years.)

Intel's current incarnation of SMT is pretty similar to when they implemented it in Nehalem; see David Kanter's Nehalem deep-dive for more on that.

https://www.realworldtech.com/alpha-ev8-smt/ is a good intro to the SMT concept; Alpha EV8 was planned to be the first commercial CPU with SMT working the say it does in current out-of-order exec CPUs with it. DEC cancelled it late in the design process. Intel hired much of the design team who went on to re-implement SMT in Pentium 4, the first time the Hyperthreading marketing name popped up.


"Multithreading" in a CPU-architecture context includes SMT, but also coarse-grained things like "switch on stall" or in-order barrel processors. So it's a much broader term; there's a Wikipedia article that covers many of the strategies.

"Multithreading" in computer science in general is more about operating-system and software-level stuff.

Peter Cordes
  • 328,167
  • 45
  • 605
  • 847
  • 2
    @ChristophorosPanayiotou: cheers. If that answered your question, you can click the checkmark under the vote arrows. – Peter Cordes Oct 21 '22 at 11:25
  • Good answer, as usual! Note that some (Intel) CPUs do not have SMT (even though the architecture supports it). This is the case of my (not too old) i5-9600KF processor for example. – Jérôme Richard Oct 21 '22 at 11:39
  • 1
    @JérômeRichard: Right sure, I didn't mention Intel's market-segmentation feature-disabling of HT in many i5 CPUs, or AVX in Pentium/Celeron before Ice Lake. Also, the E-cores in Alder Lake are Gracemont, thus no HT, which is why most Alder Lake CPUs have a hardware "thread" count that isn't 1x or 2x the physical cores. But if an Intel CPU has multiple logical cores per physical core, it's with SMT. (Not coarse-grained switch-on-stall or things that Hyperthreading sometimes gets mis-described at.) – Peter Cordes Oct 21 '22 at 11:53
  • 2
    It is probably important to note that SMT implementations differ considerably in their ability to allocate resources across the threads. Early implementations were limited to static partitioning of many resources, leading to decreased performance of a single thread when SMT mode was enabled. Newer processors gradually lifted the restrictions (and increased the resources). It is now difficult to measure any difference in single-thread performance between SMT-enabled and disabled modes in Intel CPUs. These changes have also greatly increased the fraction of workloads that benefit from SMT. – John D McCalpin Oct 21 '22 at 14:39
  • 1
    Technically, an implementation of Itanium had Hyper-Threading that was SoEMT. Marketing terms do not have to be reasonable or consistent. The computer architecture use of "multithreading" typically refers to a core supporting multiple threads without software scheduling, usually distinguishing fine-grained, switch-on-event, and simultaneous MT. There is naturally some fuzziness; e.g., ARM's fast interrupt context might be considered a (partially) separate thread with specific switch events, MIPS defined full GPR context interrupt contexts. Even the definition of core can be fuzzy. –  Oct 21 '22 at 15:56
  • @PaulA.Clayton: Thanks for the teminology correction that "multithreading" is a general term in computer architecture. There's even a wiki article for it; added a link to the answer. Also, thanks for the Itanium counter-example; I fell into the trap of saying "Intel CPU" when I meant "Intel x86 CPU". – Peter Cordes Oct 22 '22 at 01:57