My engine (Feuerstein, UCI-protocol, written in Delphi) seems to have some trouble with communication to Arena/Polyglot, resulting in occasional time losses in ponder mode games. Therefore, I removed threading as a possible source of complications and logged every action. Much to my surprise, problems do not occur when my engine reads input but when it writes an output line - although that is done by a simple call to the WinAPI function WriteFile. Incidentally the same method is used the Delfi 5.1 source. Further logging showed that when in ponder mode, the execution of one single WriteFile command (without Overlap structure) usually works instantly, but sometimes requires around 5-10 seconds or even more. This usually happens in ponder mode, and the only special circumstance I could discover was that the problem usually occured when a few write operations were done in quick progression.
Is there some kind of timeout for WriteFile operations under Windows? Has anybody experienced (and solved) a similar problem?
Further questions:
1. How can it be that engines who run fine without pondering and use the same communication methods in ponder mode experience problems in ponder mode games at fast time controls?
2. The problem described above (i.e. the engine hangs for several seconds with 0% CPU load during a WriteFile execution) only happens when communicating with the Arena interface. In communication with the Polyglot interface, WriteFile always work instantly, but the communication Engine <-> Polyglot <-> WinBoard seems to get stuck at similar random intervals, only the reason is hard to investigate because the Polyglot log lacks timestamps. Is there a Polyglot option that would make Polyglot add timestamps to its log file?