Author: Robert Hyatt
Date: 14:48:18 07/07/98
Go up one level in this thread
On July 07, 1998 at 13:19:21, Alessandro Damiani wrote: >Hi all! > >With XBoard one can program pondering using interrupts (SIGINT). But WinBoard >doesn't interrupt search and Tim Mann doesn't recommend the use of signals. > >How can pondering be programmed that it works with XBoard and WinBoard? > >Alessandro You have to have two pieces of code. For unix/xboard, use select() to see if you need to read something from stdin, which is how xboard communicates with the chess engine. If select() says that a read is possible (put stdin in the read list for testing here) then you just read a line and do whatever is required. Beware of using scanf, fgets or other buffered I/O, because the I/O library can read stuff into a buffer, and the select() will fail. Look at CheckInput() in Crafty, and go to utility.c and examine ReadInput() to see the easiest way to do I/O. For winboard, you need to use PeekNamedPipe() instead. There is an example of this in Crafty as well, in function CheckInput() in utility.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.