Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Interruption and C++

Author: Anthony Cozzie

Date: 05:08:19 08/26/03

Go up one level in this thread


On August 26, 2003 at 07:34:42, dominique LONGBIEN wrote:

>Hi there
>Is any body use an interruption (i.e. every 200ms) to look at the input buffer
>to know if a message from winboard or arena is present ?
>If yes, how should i declare this interrupt in C++ for windows ?
>Is it a good idea ?
>
>Thank for any help
>
>Dominique (adam)

There are two usual approaches:

Crafty does something like:

if(nodes % 10000 == 0 && check_for_input())
  process_input();

Zappa sets up a few threads and has one block on fgets.  Crafty's is definitely
easier, but I think Zappa's is cleaner. YMMV.

anthony



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.