Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Engine timing in evaluation help needed

Author: Robert Hyatt

Date: 20:55:02 01/17/06

Go up one level in this thread


On January 17, 2006 at 23:40:07, Joshua Shriver wrote:

>When doing time controls for evaluation,what's the most efficient way of doing
>it?
>
>Right now at the start of the game I just do the typical check of x seconds
>since Jan 1 1970, and keep polling the time.
>
>This seems to eat up a lot of CPU time that could be used for the evaluation
>itself.
>
>My engine is implemented in C. Was wondering can you do alarm signal in C like
>you can in Perl? If so then you can just have the OS send a alarm signal when x
>seconds have passed. In Perl this is really efficient and saves a lot of CPU
>cycles.
>
>Thanks for the help in advance.
>Josh


I only check every N nodes.  For a normal game, N is the number of nodes I
usually search in a second, which means I pop the system time check call about
once a second, which is zero overhead...

Alarms are workable, but you lose portability.  A separate thread for the search
which never checks the time is workable, letting the main thread sleep and check
the time whenever it wants, or just sleep until enough time has elapsed, etc...



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.