Re: Hyperthreading vs. SMP

From: Robert M. Riches Jr (
Date: 12/13/03

Date: Sat, 13 Dec 2003 00:29:47 GMT

In article <>, wb wrote:
> Can someone explain the difference between a processor
> that is "Hyperthreading" and an SMP system, or maybe just
> what is HyperThreading ( actually I know what SMP is ).
> Is Hyperthreading simply the ability to be executing
> multiple instruction pipe lines ?

>From a hardware perspective...

With an SMP system, you have two _physical_ procesors.
Usually, they are two separate physical packages, each with
a separate heatsink and fan(s).

With hyperthreading (multithreading to those of us who were
on the design team), each physical processor is logically
split into multiple virtual processors. Many of the data
resources on the chip (register renaming and instruction
scheduling tables, for example) are split, one chunk of
resource hard-allocated to each virtual processor. While
the reduction in size of the split-up resources to each
virtual processor does slow down said virtual processor a
little bit, because there is more instruction-level
parallelism available with multiple instruction streams than
with a single instruction stream, you get more total
combined performance from the virtual processors than you
would from a single processor. Execution of the instruction
streams by the multiple virtual processors is interleaved in
time inside the single physical processor.

At least in theory, you can have _both_ SMP and
hyperthreading, which gives you even more virtual
processors. With hyperthreading, if you have multiple
threads in the run queue, you can run as many threads
concurrently (in run state) as you have virtual processors.

At least some compilers are able to produce code to make use
of hyperthreading by a single binary executable. So, in at
least some cases, you can gain speed advantage from
hyperthreading, even if you have only one program running.

If you're interested in the computer architecture issues
surrounding hyperthreading, there are some good old
discussions in newsgroup comp.arch many years ago about the
'barrel processor' which could switch between many threads.

(Disclaimer: While I did oversee schematic formal
verification on the Pentium 4 Processor, which implements
hyperthreading, I'm confident all of the above information
is publicly available. I wouldn't give away any of my
former employer's trade secrets, even if I knew any.)

Good luck.

Robert Riches
(Yes, that is one of my email addresses.)