DroidFish: Better handling of large amounts of data from the engine.

This commit is contained in:
Peter Osterlund 2016-12-19 23:02:13 +01:00
parent 97160698a9
commit af9b505e87

View File

@ -687,6 +687,16 @@ public class DroidComputerPlayer {
if (Thread.currentThread().isInterrupted())
return;
String s = uci.readLineFromEngine(timeout);
long t0 = System.currentTimeMillis();
while (s != null && !s.isEmpty()) {
if (Thread.currentThread().isInterrupted())
return;
processEngineOutput(uci, s);
s = uci.readLineFromEngine(1);
long t1 = System.currentTimeMillis();
if (t1 - t0 >= 1000)
break;
}
if ((s == null) || Thread.currentThread().isInterrupted())
return;
processEngineOutput(uci, s);
@ -1041,6 +1051,7 @@ public class DroidComputerPlayer {
listener.notifyStats(id, statNodes, statNps, statTBHits, statHash, statTime);
statsModified = false;
}
lastGUIUpdate = System.currentTimeMillis();
}
private final static void myAssert(boolean b) {