Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Approaches to threading

Author: Dann Corbit

Date: 15:10:55 06/15/04

Go up one level in this thread


On June 15, 2004 at 17:24:59, Eric Oldre wrote:

>
>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 vb.net. Although as I improve the evaluation it will slow down of
>course.
>
>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
>threading.
>
>Is there a 3rd approach to look at?

POSIX threads can be used in Win32 programming also.
http://sources.redhat.com/pthreads-win32/

>Is there a performance advantage to either?

Negligible

>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.

All about the same.

If you were using C++, ACE would be a good way to go, since it will target many
different platforms with a single consistent API.
http://www.cs.wustl.edu/~schmidt/TAO.html

I think that SMT:
http://www.imatix.com/html/smt/index.htm
does not differentiate between thread types like ACE, so that a thread can be a
background thread or a CPU hogger.  So probably it is not as good of a choice.


Probably, there are lots of other choices.




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.