4

Possible Duplicate:
Hyper-Threading and Dual-Core, What's the Difference?

Most Intel processors feature what they call "hyperthreading," basically another virtual core for each physical core.

Is there a significant difference between these virtual cores and physical cores? For example, if I bought an 8-core machine and a hyperthreaded quad-core both at the same clock with similar specifications, would the 8 physical core machine outperform the quad-core-with-hyperthreading machine?

Naftuli Kay
  • 9,481
  • 19
  • 56
  • 88
  • possible duplicate of [Hyper-Threading and Dual-Core, What's the Difference?](http://superuser.com/questions/133082/hyper-threading-and-dual-core-whats-the-difference) also see: [What is hyper-threading and how does it work?](http://superuser.com/questions/122536/what-is-hyper-threading-and-how-does-it-work) – Ƭᴇcʜιᴇ007 Nov 17 '11 at 03:53

2 Answers2

7

Yes, there is a difference.

Obviously, physical cores would only outperform the virtual cores if programs actually use them. :)

Virtual cores simply take advantage of CPU stalls to process another thread, while the CPU is waiting. When nothing is stalling, though, they don't run more instructions at a time than a single core.

Physical cores, on the other hand, actually run multiple threads in parallel; they are very similar to multiple physical processors, except that caches and such components might be shared at some levels.

user541686
  • 23,663
  • 46
  • 140
  • 214
  • Note that this answer is talking about a version of hyperthreading that has very little to do with the kind of hyperthreading modern CPUs have. – David Schwartz Apr 10 '16 at 21:57
  • @DavidSchwartz: Not sure what you mean, elaborate? – user541686 Apr 10 '16 at 22:28
  • 2
    This answer was applicable to the ancient form of hyperthreading available on the Pentium 4 but is totally inapplicable to modern hyperthreading which has nothing to do with taking advantage of CPU stalls and does run more instructions at a time even if nothing stalls. For example, if one thread is doing only integer operations, the other thread can use all the floating point units all the time. – David Schwartz Apr 10 '16 at 22:36
  • @DavidSchwartz: You're right that I was indeed referring to Pentium 4 HT when I wrote it, but I'm not sure I agree that the definition has really changed. Are you sure you're talking about "hyperthreading" and not a different term like a "superscalar" CPU or "simultaneous multi-threading"? If you really mean hyperthreading is different now, can you provide me a link that explains the details of what you're trying to say? – user541686 Apr 10 '16 at 22:38
  • I'm talking about modern hyperthreading. Each thread has equal access to the resources on the core and they can both run at full speed so long as they don't exhaust the supply of execution units at any particular time. Of course, if they both try to use all the floating point multipliers, then one will have to wait for the other. – David Schwartz Apr 10 '16 at 22:40
  • @DavidSchwartz: I wasn't aware that's called hyper-threading? I thought it fell under SMT and superscalar processing but I thought HT only referred to what I wrote... I guess not? – user541686 Apr 10 '16 at 22:44
  • Intel calls any scheme that runs more than one thread at a time in the same physical core "hyperthreading". – David Schwartz Apr 10 '16 at 22:47
  • @DavidSchwartz: Huh, okay, thanks for clarifying. – user541686 Apr 10 '16 at 22:52
4

Well, the difference is so significant, you could end up with no performance difference between a dual core with hyperthreading and a regular dual core. Consider hyperthreading as a 'recycling' feature, it could use clocks that otherwise unusable due to memory access. But on simplistic process, it could give you no improvement at all.

Martheen
  • 1,503
  • 1
  • 13
  • 27