Computer Chess Club Archives




Subject: Approaches to threading

Author: Eric Oldre

Date: 14:24:59 06/15/04

First off, I've taken everyone's advice from last week and changed my engine so
that most functions take a pointer to a board object as a parameter instead of
operating on a global board.

I now have it doing a basic alpha-beta search with QSearch, a basic evaluation,
and MMV/LVA move ordering. It is also returning and printing out the PV.

At this point (having hardly anything tuned) it's already as fast as my old
engine in Although as I improve the evaluation it will slow down of

My next step is to get it implementing the winboard protocol, perhaps UCI as
well. I've decided to take a approach where i have the main thread read commands
from winboard, and a separate "thinker" thread work on the problem. similar in
concept to what i saw in the Gerbil source.

Since this is the first program I've written in C. I don't have much experience
with multi-threading in C. I've started to create something using the
CreateThread and ExitThread calls in <windows.h>. I was wondering if people felt
that was a good idea, or if I'd be better off trying to learn about POSIX

Is there a 3rd approach to look at?

Is there a performance advantage to either?

Does one have a much easier learning curve than the other? What i've done so far
with the <windows.h> stuff hasn't seemed to difficult to grasp, but I'm not
terribly far along yet.

Eric Oldre

This page took 0.06 seconds to execute

Last modified: Thu, 07 Jul 11 08:48:38 -0700

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