Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: HyperThreading Revisited

Author: Jeremiah Penery

Date: 19:30:48 11/08/02

Go up one level in this thread


On November 08, 2002 at 20:59:09, Nolan Denson wrote:

>I was in a seminar today for hyper-threading. A demonstration was put on to
>explain how it actually works. What I found out is very interesting and I am
>wondering if a chess program can be designed or with a little tweaking can take
>advantage of it.  As many of you know that hyper-threading takes advantage of
>the operating system by making the system think there are twice as many
>processor. So here is my explanation it’s a simpler way that explains the
>situation. System (A)  has 1 processor running task ... the cpu hands off the
>info to a register that executes that operation. So while the processor is
>waiting for the register to do its thing ... it’s losing valuable time by
>waiting. So with hyper-threading we throw in a second cpu, which basically
>performs the same task as the first cpu.  All seems great until you both cpu's
>are trying to send info to the same register. So then we get the big slow down
>with hyper-threading.  So how can we improve on that ??? Answer By having


The two threads should never be competing for the same registers.  All(?)
current architectures that I'm aware of have large numbers of what are called
'rename registers' - at least one such register for every in-flight instruction
that is possible.  The P4, for example, has something over 100 maximum in-flight
instructions, which means it also has 100+ rename registers.  Every instruction
issued has its destination register uniquely renamed within the processor, so
that the race condition you're describing should not be able to happen.

>multi-tasking applications. So basically in our situation above .. the
>application is what needs to take advantage of hyper-threading ... that way both
>processor are busy ... one processor could be doing one part of the chess
>program and the other another part. So multithreading chess programs will have a
>problem and multi-tasking will see the speedup.

What kind of things do you suggest for 'multi-tasking' in a chess program?  The
only possible use for a second thread, if it isn't doing the same thing as the
first thread, is to do I/O or something.  But the I/O thread uses almost 0 CPU
time, so it really doesn't give any speedup to have a second processor just for
that.

>Now what I am wondering is such a thing possible for a chess program?
>
>Can a program like crafty take some of its threads and do something else that
>doesn't use the same register's?

See above question.  Also, see above explanation about rename registers.

>Can a chess program take advantage of hyper-threading, by becoming more like a
>multitasking program that still uses multi-threads also ??



This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.