Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Windows Port

Author: Peter McKenzie

Date: 11:04:08 02/22/01

Go up one level in this thread


On February 22, 2001 at 10:57:27, James Swafford wrote:

>
>Have you tried compiling under Cygwin? (www.cygwin.com)
>It's a free win32 port for gcc.  It may be much easier to produce
>a win executable with that... and on the tests I've done the
>cygwin binaries were faster than the MSVC 6 binaries with
>full optimizations.
>
>As far as checking for input every N nodes - this conversation
>recently came up with David.  Why not just spawn off a thread
>to wait for user input?  I've done it and it worked well.  The
>only thing I check "every N nodes" for is time expiration and
>a global "kill search" flag (indicating, for example, the
>user input thread may need the search to stop).

Yes, this is similar to the way I do it in LambChop.

Actually, I have 3 threads:
- the engine thread (the thing that does the search etc)
- the control thread (with winboard logic etc)
- the input thread which is just a simple loop which uses blocking input to feed
a circular buffer.  If the buffer is full, it sleeps.  In effect I'm using
blocking input plus an extra thread to simulate non-blocking input.

So my approach is a little more work, but it gives you full control.

cheers,
Peter

>
>--
>James
>
>
>On February 21, 2001 at 22:34:06, Scott Gasch wrote:
>
>>Hi,
>>
>>I'm porting my engine to windows.  Actually Dann did a really cool thing and got
>>it to build already over on the other side... now I am just polishing and
>>cleaning up details.
>>
>>Many interesting things have come up... quriks and whatnot.
>>
>>I'm stuck on one right now and before I do the drastic to work around it, I
>>wondered if anyone had some advice.  I needed some code to do the same thing as
>>"select" on UNIX (is there input on this file descriptor?).  So after reading
>>MSDN, Tim Mann's site and crafty code I came up with PeekNamedPipe and/or
>>GetNumberOfConsoleInputEvents solution.
>>
>>Problem: when searching my code is checking for input every N nodes... and not
>>performing well because CSRSS.EXE is eating about 40% of the processor.  This is
>>due to my new "select" code.  When I remove it I gain, literally, 100knps.
>>What's the deal with this?  I have always heard that console mode windows is a
>>nightmare but never expected this kind of stupidity.  Anyone have a better way?
>>
>>Thanks,
>>Scott



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.