Author: Robert Hyatt
Date: 10:48:32 08/12/98
Go up one level in this thread
On August 12, 1998 at 11:13:06, fca wrote: >This has arisen from a post by Mr Langrath elsewhere. > >If multitasking two chess programs on one PC, and playing a game between >them, how does one "fairly" allocate resources between them? > >I accept there is no question of properly deducing playing strength in such a >scenario. That is NOT the objective, therefore. > >0. What does "fairly" mean? > >1. RAM? > >2. CPU %? > >3. Idle / background priority? > >4, Thinking Time set on program? > >and especially > >5. Should permanent brain be switched off on one or both programs? > >Ideas on how to arrive at the answers, please, or better still - the answers >themselves. :-) > >Kind regards > >fca > >PS: This is I believe one of the more interesting questions for newbies and >others. So please confine trolling answers to the other place. This comes up so often. :) The biggest problem is that chess programmers tend to write code as though their program is the only thing running on the machine. I remember an early version of Crafty playing against an older version of ChessMaster, and crafty was getting eaten alive. When I would play over the games, I could never get it to make some of the really bad moves, and asked for the log files (this was back when I was searching 30K nodes per second on a P5/133mhz machine). The games were being run on an older 486, which I knew was going to be probably 5x slower, so I was expecting 4-6K nodes per second. I was getting about 1K. What we found was that the old version of ChessMaster had an input loop where rather than doing a normal read, it just continually asked "has a key been pressed? NO. has a key been pressed? NO." over and over, and burning cpu cycles even when it wasn't thinking. Which meant that even if you turned off thinking on the opponent's time, CM was using 1/2 of the cpu cycles when crafty was thinking, but when crafty was "waiting" it did a simple read() which blocked it until CM made a move and the operator entered it. Bottom line: two programs on a single machine is always a bad idea. There can be interactions like the above where one hogs the CPU without your knowing, or where one hogs memory and makes the other page at the beginning of each move. Or any of several other things, which can (but don't always) affect the outcome of games. I used to do lots of crafty vs crafty and crafty vs gnuchessx testing on a single CPU, because in unix, this sort of I/O "polling" is generally not done, and it can work o.k. But I also knew that running a match may well hurt one more than the other, if one does a better job of predicting the other's moves, because it won't get to take advantage of that...
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.