Linked by David Adams on Wed 4th Aug 2010 18:28 UTC, submitted by estherschindler
Hardware, Embedded Systems Anyone contemplating a new computer purchase (for personal use or business) is confronted with new (and confusing) hardware choices. Intel and AMD have done their best to differentiate the x86 architecture as much as possible while retaining compatibility between the two CPUs, but the differences between the two are growing. One key differentiator is hyperthreading; Intel does it, AMD does not. This article explains what that really means, with particular attention to the way different server OSes take advantage (or don't). Plenty of meaty tech stuff.
Thread beginning with comment 435426
To view parent comment, click here.
To read all comments associated with this story, please click here.
RE: Comment by another_sam
by Brendan on Wed 4th Aug 2010 20:22 UTC in reply to "Comment by another_sam"
Brendan
Member since:
2005-11-16

Hi,

"At some point, the pipeline may stall. It has to wait for data, or for another hardware component in the computer, whatever. We’re not talking about a hung application; this is a delay of a few milliseconds while data is fetched from RAM. Still, other threads have to wait in a non-hyperthreaded pipeline, so it looks like:
thread1— thread1— (delay)— thread1—- thread2— (delay)— thread2— thread3— thread3— thread3—"

I don't get a clear picture of this added to what they told me about OS scheduling at college.


That's because the article uses confusing terminology (I'm seriously wondering if the article's author knows the difference between hyper-threading in hardware and multi-threading in software). It's also a little misleading ("a few milliseconds while data is fetched from RAM" only makes sense if your RAM is *insanely* slow).

A (hopefully) better explanation might be:

If a core is pretending to be 2 logical CPUs; then if the core can't execute instructions from one logical CPU (e.g. because data needs to be fetched from RAM) then it can still execute instructions from the other logical CPU, and the core doesn't have to just sit there doing nothing...

-Brendan

Reply Parent Score: 2

RE[2]: Comment by another_sam
by Tuishimi on Wed 4th Aug 2010 21:32 in reply to "RE: Comment by another_sam"
Tuishimi Member since:
2005-07-06

But from what I read, and I am probably very wrong, it sounds like the virtualization going on uses two parts of the physical CPU for differing instruction sets, but wouldn't they both need to be utilized in a clock cycle?

:/ This is why I didn't to EE and did CS instead. ;)

Reply Parent Score: 2

RE[3]: Comment by another_sam
by Zifre on Wed 4th Aug 2010 22:54 in reply to "RE[2]: Comment by another_sam"
Zifre Member since:
2009-10-04

But from what I read, and I am probably very wrong, it sounds like the virtualization going on uses two parts of the physical CPU for differing instruction sets, but wouldn't they both need to be utilized in a clock cycle?

I'm not sure I exactly understand what you're saying, but you are probably right in that you are probably very wrong. ;)

Here is how I would explain hyper-threading:

A logical CPU (which could be an entire CPU, a core, or a "hyper-thread", depending on the setup) executes instructions from RAM. Mostly all these instructions can do is access RAM and manipulate CPU registers. So the only state that a logical CPU needs to run is the registers (since RAM is shared). So, a hyper-threading core (which is a physical section of the chip that has one set of the things that execute instructions) has two copies of all the registers, one for each "hyper-thread". When it is executing a "hyper-thread", and it has to wait for something slow (such as access to RAM), it can switch to the other set of registers. This, in effect, causes the other "hyper-thread" to run. It constantly switches back and forth so that the core is rarely waiting for something, and thus, performance is improved without adding an entire new core.

Edited 2010-08-04 22:54 UTC

Reply Parent Score: 3

RE[3]: Comment by another_sam
by tony on Thu 5th Aug 2010 00:06 in reply to "RE[2]: Comment by another_sam"
tony Member since:
2005-07-06

But from what I read, and I am probably very wrong, it sounds like the virtualization going on uses two parts of the physical CPU for differing instruction sets, but wouldn't they both need to be utilized in a clock cycle?

:/ This is why I didn't to EE and did CS instead. ;)

I don't know about the other virtualization technologies, but with VMware you can have two cores, each with two execution units (hyperthreading). This scenario often looks like 4 CPUs to an OS, even though there's only 2 cores. VMware is smart enough to pick two execution units that are on separate processors when giving CPU time to a virtual machine granted two processors (vCPUs).

Reply Parent Score: 2