Winboard support

Programming Topics (Computer Chess) and technical aspects as test techniques, book building, program tuning etc

Moderator: Andres Valverde

Winboard support

Postby Jaco van Niekerk » 06 Aug 2006, 15:48

Hello all

Reading through all these threads, I've come to the conclusion that my knowledge of chess engine coding is rather embarrassing. Nevertheless it is a great project which I am really enjoying.

I?ve started writing my engine in Java with the idea to port it to C later on. I would however like to build in Winboard support from the start. However, I am not sure how to support certain functions like "force move" and other interrupt-like commands, without taking too much processing time from the main engine.

Do I put the listening part in its own low-priority thread and the engine in a high-priority thread and merely ?kill? the engine thread when a "force move" (or similar) is received? Will graceful termination of the engine thread lead to unacceptable overhead? Any ideas would be appreciated ? thanks!
User avatar
Jaco van Niekerk
 
Posts: 31
Joined: 30 Jul 2006, 21:23
Location: South Africa

Re: Winboard support

Postby Alvaro Begue » 07 Aug 2006, 19:22

Every few thousand nodes you can call a function to check if there is input to be processed. If there is and the search needs to be stopped, you can either throw an exception or just set a flag and return from the current function. Make sure that your search loops abort whenever that flag is set.

You can also check the time when you check if there is input, since too much time elapsed should also trigger a "move now".

You can time the engine with and without this functionality, and the difference should be tiny, unless you implement it in some horrible way.
Alvaro Begue
 
Posts: 33
Joined: 03 Aug 2005, 23:48
Location: Stony Brook, New York, U.S.A.


Return to Programming and Technical Discussions

Who is online

Users browsing this forum: No registered users and 42 guests