Author: Dann Corbit
Date: 18:29:07 12/30/99
Go up one level in this thread
On December 30, 1999 at 18:53:04, Tom Kerrigan wrote:
>Although I love C and I usually don't approve of object-oriented programming, I
>think there are compelling reasons to use objects in a chess program.
>
>Specifically, I want to have a chess board class, which contains the data and
>functions necessary to manipulate a chess board. I also want to have an engine
>class, which extends the chess board class, and adds the functions necessary to
>search the board.
>
>I have two questions:
>1. When I access the chess board class from the engine class, will there be a
>performance hit?
As close to zero as is humanly imaginable unless you do some exotic things like
RTTI. SEH takes a small toll also. Templates often give a performance BOOST.
>2. If I have multiple instances of the engine class, can each one run on a
>different processor without a performance hit?
That is an architecture question that cannot be answered without the complete
model. I assume that they must talk to each other or at least communicate with
a common object. When starting threads, some API's have lightweight and
heavyweight threads. A heavyweight thread demands a processor and a lightweight
one shares processors {in concept anyway}. The ACE library has a nice way to
abstract all of this so that it works on any architecture. Highly recommended.
Comes with source and there are no strings attached (can be used commercially
without compensation -- just mention that you use it).
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.