Page 1 of 1

Winboard support

PostPosted: 06 Aug 2006, 15:48
by Jaco van Niekerk
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!

Re: Winboard support

PostPosted: 07 Aug 2006, 19:22
by Alvaro Begue
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.