lucasart / c-chess-cli

Command Line Interface for UCI Chess engines written in C
GNU General Public License v3.0
71 stars 9 forks source link

remove sample buffering #40

Closed lucasart closed 3 years ago

lucasart commented 3 years ago

no point in collecting samples in a vector, then writing them. i can write them on the fly, leveraging the fact that fwrite() and fputs() already provide buffering (and file locking) under the hood. the only rule is that each sample must be written in a single stdio function call (to leverage the embedded locking).

lucasart commented 3 years ago

can't do. result is not known until end of game, which is why buffering had to be done.