Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: A Delphi - WinBoard problem

Author: Tony Werten

Date: 04:08:10 09/25/04

Go up one level in this thread


On September 24, 2004 at 14:45:38, Martin Giepmans wrote:

>
>In my Delphi engine I have a thread that polls input when the engine is
>connected to WinBoard.
>Now it turns out that it steals time when it plays another engine under WinBoard
>with pondering off.
>According to TaskInfo it still claims about half of the processor time when the
>other engine is thinking.
>I have tried sleep() but it doesn't work, perhaps because I don't use sleep() in
>the right way.
>
>Does anybody know how to solve this problem in Delphi?

The polling routine is ok. It will block while there is no input.

My guess is that the problem is in your pondering.

Do you have a sleep in your waiting function ?

ie

While not(oppo_made_move) do
begin
   application.processmessages;
   sleep(50);
end;


Tony

>
>
>My polling routine looks like this (I left out what is not relevant):
>
>procedure Tconindraad.Execute;
>
>var c:char; buffer:string;
>
>begin buffer:='';
>repeat
>if conintekst='' then
>  begin read(input,c);
>  if c=#10 then
>    begin if buffer<>'' then conintekst:=buffer;
>    buffer:=''
>    end
>  else buffer:=buffer+c
>  end
>until terminated
>end;
>
>
>(The content of buffer is passed to conintekst. The engine reads conintekst
>and sets it to '', so that the polling routine knows that the engine is
>ready for the next input)
>
>
>Martin



This page took 0.01 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.