Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Building a UI

Author: Bo Persson

Date: 03:10:01 07/05/98

Go up one level in this thread


On July 04, 1998 at 13:37:34, James Long wrote:

>In my quest to build a custom UI for my program,
>I've come across the following problems:
>
>1)  During the search, it is impossible to pull
>down a menu, minimize the program, or do *anything*
>else until the search is done.

That is because your program is not checking messages
in the Windows' message queue. See PeekMessage() in
the reference!

>2)  Updating the (displayed) clocks is a problem.
>I'm using C++/MFC, so I tried setting
>a timer that called a function to check if the
>clocks were up to date (every 500 milliseconds).  No
>problems while the user is on move, but the clocks don't
>get updated during the search.

See PeekMessage() above :-)

>A friend on ICC suggested I spool off a worker thread
>when the computer goes on move, which would leave
>the interface thread free to check for user input.
>So my question is - would doing so take (much) time away
>from the search?  If the CPUs time is split between
>threads, would the engine "suffer"?

The time isn't split 50-50, the main (interface) thread
is give just as much time as it needs. Most of the time
it will be waiting for the next message, leaving the CPU
free for your worker thread.


>And the clocks - would spooling off yet another
>worker thread who's job is to keep the clocks up
>to date take yet more time away from the search?

Your timer *will* work once you let the main thread
update the screen. It will get the timer messages
and repaint the clocks. There is no need for yet
another thread.

>Please send responses via email.  I don't think I'm
>seeing all the posts.
>
>---
>James

Bo Persson
bop@malmo.mail.telia.com




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.