Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Separate Thread or plain Loop??

Author: José Carlos

Date: 06:59:35 12/18/01

Go up one level in this thread


On December 18, 2001 at 09:32:55, Tony Werten wrote:

>On December 18, 2001 at 07:27:47, Steve Maughan wrote:
>
>>I'm thinking about implementing pondering in my chess progam.  I guess I have
>>two options - either create a separate thread for the engine or use some form of
>>loop that checks for input and responds accordingly.  The latter seems like a
>>pseudo thread and may take up significant processor time.  I have never written
>>a program that creates separate threads and I guess that if I do go down that
>>route I'll have to deal with syncronization and other unknown complications.
>>
>>Do others create separate threads?  Are there any advantages / disadvantages
>>with creating a separate thread for the search?  What effect will it have on the
>>speed?  Will it mean that in the long-run it will be able to interface more
>>smoothly with the GUI?  Are there any simple solutions?
>
>Hi Steve,
>
>forget the thread stuff. Basicly, pondering is quite easy. If you know the
>opponents best move (from last search, the 2nd move in pv ) make it and pretend
>it's your move again. Easiest is having 2 boards. One that has the root position
>and one you use in your search.
>
>Now the pitfalls:
>- The opponent does a different move then you expected. Unmake the move you
>expected, make the right move, it's your turn again.
>- Don't jump out when pondering and only 1 possible move.
>- Don't jump out when time runs out
>- Don't jump out when you have reached the max depth
>- Don't jump out when you found a checkmate.
>- Don't ponder when you don't have an expected move. (sounds logic ? Well, if
>your make_move is not protected from doing nullmoves it really messes up things)
>- Don't do your move if the opponent does the expected move but you just got a
>big fail low. ( Nasty one, costed me a couple of points in tournaments)
>
>I think you can just start at the top of my reply and add the stuff in this
>order.
>
>Good luck,
>
>Tony
>
>>
>>All help appreciated!
>>
>>Regards,
>>
>>Steve

  I can add that, when the opponent makes his move, you can use a very simple
approach that works fine for me: retract your pondered move, make opponent's
real move and start searching as if nothing had happened. The hash table will
lead you to the point you were in ponder search very soon. I must say that my
time allocating algorithm uses, usually, less time than other programs, and I
only trigger time extensions if a fail low or other bad things happen, so I
usually finish my post-pondering search very soon.

  José C.



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.