Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: advantages to board pointers

Author: Dieter Buerssner

Date: 13:59:13 06/10/04

Go up one level in this thread


On June 10, 2004 at 16:26:01, Eric Oldre wrote:

>My questions are:
>1) Am I right that the pointers to the board are used so that crafty can use
>multiple processors?

I would think so.

>Would there be a way to use multiple processors without
>this technique or something similar?

If you start multiple processes (and not multiple threads) the global board will
still work.

>2) What other advantages would there be to passing the pointers to the tree? (if
>any).

I think, passing a "Position structure" is cleaner, and possible less prone to
errors. One example where it could have helped me, is for move input while
pondering. If you want to allow for example SAN input besides other forms, you
will need to know the position before the ponder search. My input move parser
worked on the global board. But during ponder, this is changed. So I did some
nasty hacks to allow it (and at one time, I actually optimized them away again,
because I could not see some sense in it anymore, to detect one night before the
Paderborn tournament, that pondering was broken. Took me a while then, to figure
out why).

>It would seem to me to cause some performance hit on single processors.

It might depend on many things if you see a performance hit and how much. I
could even think about examples, where typical written code might be better with
the pointer idea. Your code might cache some indirection in a var locally,
instead of using p->var, while typically you might not bother to do it, if you
could use [global]var instead. This for example can give the optimizer more
chances, to optimize things. Of course, in general one would expect worse
performance.

Regards,
Dieter



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.