Re: Detecting CPUs and cores



On Tue, 31 Jul 2007 12:05:07 +0100, Lew <lew@xxxxxxxxxxxxxxxx> wrote:

Patricia Shanahan wrote:
A programmer may have determined experimentally that two threads running
on different cores get significantly more throughput than one, but that
the same two threads running hyper-threaded get less throughput than
one. The program is written so that the number of threads is a free
parameter.
The program should limit the number of threads to be no more than the
number of cores, but cannot because it cannot tell the difference
between two separate cores and a single hyper-threaded core.

It is likely that the two hyper-threaded cores will achieve more throughput than on one of those "cores". The reason Intel provided hyperthreading is that it increases throughput on the chip.

That's the theory, but it's less clear cut than with a "proper" dual core chip. There is anecdotal evidence of people turning *off* Hyper-Threading in the BIOS to improve the performance of their applications.

http://news.zdnet.co.uk/hardware/0,1000000091,39237341,00.htm
http://www.javalobby.org/java/forums/t54590.html

I haven't personally benchmarked the effect of Hyper-Threading but, if your application is relying on the result of availableProcessors() to fine tune it's concurrency strategy, it's important to be aware that 1 HT CPU may behave quite differently from 1 dual-core CPU.

Dan.

--
Daniel Dyer
http://www.uncommons.org
.



Relevant Pages

  • Re: XP Home on a quad?
    ... "Many differences exist between Windows XP Home and Windows XP ... which the most widely used is Intel's Hyper-Threading technology. ... which features two processor cores per die. ... if you have more than one physical processor (such as two ...
    (microsoft.public.windowsxp.hardware)
  • Re: Detecting CPUs and cores
    ... throughput than on one of those "cores". ... The reason Intel provided hyperthreading is that it increases throughput on the chip. ...
    (comp.lang.java.programmer)
  • Re: To hyper-thread or not to hyper-thread
    ... It signifies the presence of the ability to ... multiple cores and if the number of siblings equals the number of cores ... hyper-threading is disabled. ...
    (Fedora)
  • Re: Detecting CPUs and cores
    ... Lew wrote: ... the same two threads running hyper-threaded get less throughput than ... number of cores, but cannot because it cannot tell the difference ... benchmarks that they simulate during processor design. ...
    (comp.lang.java.programmer)
  • Re: Detecting CPUs and cores
    ... Patricia Shanahan wrote: ... the same two threads running hyper-threaded get less throughput than ... number of cores, but cannot because it cannot tell the difference ... The reason Intel provided hyperthreading is that it increases throughput on the chip. ...
    (comp.lang.java.programmer)