Threaded Input/Search Implementation for Winboard Protocol

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

Moderator: Andres Valverde

Threaded Input/Search Implementation for Winboard Protocol

Postby Pradu » 10 Sep 2006, 14:25

I'm trying to design an impelmentation of the winboard protocol where you have seperate threads for input and search. My current attempts at this design seem very complicated:

Image

Does anyone have a simpler way of implementing threaded input?
User avatar
Pradu
 
Posts: 343
Joined: 12 Jan 2005, 19:17
Location: Chandler, Arizona, USA

Re: Threaded Input/Search Implementation for Winboard Protoc

Postby Richard Pijl » 10 Sep 2006, 16:10

My method is rather simple, and resembles a polling implementation.

The input thread is reading input, parsing the command, and when the command is found to be syntactically correct, pushes it into a command queue.

The main program/search is checking whether there is something on the command queue periodically, or when idle, when the input thread sends an event to the main program.

The main difference with the polling implementation is that search is only interrupted when there is a full command at the input. Not, like with polling input, when the operator just happened to have touched a key, or triggered the polling function by some other means (some mouse events in win2k did that to me as well). Just got sick of it and decided to do it this way.
Richard.
User avatar
Richard Pijl
 
Posts: 105
Joined: 26 Sep 2004, 21:09
Location: Minderhout, Belgium

Re: Threaded Input/Search Implementation for Winboard Protoc

Postby Peter Fendrich » 10 Sep 2006, 20:24

Hi Pradu
Take a look at my template for a separate input thread.
It is simple I think. The same approach or at least similar to Richards.


http://alaric.fendrich.se/Inputthread,code.html

/peter
User avatar
Peter Fendrich
 
Posts: 193
Joined: 26 Sep 2004, 20:28
Location: Sweden

Re: Threaded Input/Search Implementation for Winboard Protoc

Postby Pradu » 10 Sep 2006, 20:53

Thanks Peter and Richard! I'll check it out.
User avatar
Pradu
 
Posts: 343
Joined: 12 Jan 2005, 19:17
Location: Chandler, Arizona, USA


Return to Programming and Technical Discussions

Who is online

Users browsing this forum: No registered users and 9 guests