xboard-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[XBoard-devel] xreuse and GameUnfinished


From: h.g. muller
Subject: [XBoard-devel] xreuse and GameUnfinished
Date: Fri, 19 Aug 2011 23:02:26 +0200

There is something in the XBoard code I do not understand:

In GameEnds() there is code to quit the engine if it is running
under the user option -xreuse (or has requested the reuse=0
feature by itself):

    if (first.reuse) {
        /* Put first chess program into idle state */
        if (first.pr != NoProc &&
            (gameMode == MachinePlaysWhite ||
             gameMode == MachinePlaysBlack ||
             gameMode == TwoMachinesPlay ||
             gameMode == IcsPlayingWhite ||
             gameMode == IcsPlayingBlack ||
             gameMode == BeginningOfGame)) {
            SendToProgram("force\n", &first);
            if (first.usePing) {
              char buf[MSG_SIZ];
              snprintf(buf, MSG_SIZ, "ping %d\n", ++first.lastPing);
              SendToProgram(buf, &first);
            }
        }
    } else if (result != GameUnfinished || nextGameMode == IcsIdle) {
        /* Kill off first chess program */

Why are unfinished games excluded from terminating
their engine process? With the current code they receive neither
"force" not "quit", and as far as I could see, when a user starts
a new game after this, the same engine process will receive "new"
and keep playing. (I checked process ID with "ps l" under Linux,
and after using "Action->Abort" on a game, and then starting a
new one, the PID stays indeed the same.)

This seems a violation of the -xreuse directive...

reply via email to

[Prev in Thread] Current Thread [Next in Thread]