Re: Hyperthreading vs. SMP

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


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

In article <3FDA46A5.8090906@nospam.com>, 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
spamtrap42@verizon.net
(Yes, that is one of my email addresses.)



Relevant Pages

  • Re: Hyperthreading vs. SMP
    ... > With hyperthreading (multithreading to those of us who were ... > split into multiple virtual processors. ... > parallelism available with multiple instruction streams than ... a memory ...
    (linux.redhat)
  • Re: hyper threading.
    ... >> multiple physical processors. ... >> an obvious performance gain, and hyperthreading does, too, although ... >> The poblem is not at the application level, but at the kernel level. ...
    (freebsd-questions)
  • Re: hyper threading.
    ... > and particularly well-written, threaded applications, you'll lose more ... > than you'll gain. ... In practice, multiple processors provide ... an obvious performance gain, and hyperthreading does, too, although it's ...
    (freebsd-questions)
  • Re: Simultaneous Playback of 4-video files with D1 resolution
    ... A single-threaded application will gain no benefit from hyperthreading, ... Inasmuch as on Windows there is always *something* competing for CPU time, ... an application coded with multiple *independent* threads ... share a single cache. ...
    (microsoft.public.win32.programmer.directx.video)
  • Re: On a hyperthreaded system, top and gnome system monitor only report one processor
    ... > You seem to be confusing dual-core and HyperThreading. ... > share various levels of caches (but then again, ... > definitely multiple independent CPUs. ... this case is also a good thing, and indeed neither FreeBSD scheduler ...
    (freebsd-current)