Some of the GUI code gets written by the most brilliant as with GUI's you can make big cash (facebook huh?), but majority of the code is guys who don't know how to spell the word algorithm correct let alone that they are capable of setting up a bugfree system.hgm wrote:I looked at your code, but it was not clear to me what the reason for the several delays was. This is really awful! One would expect that it would not be to difficult nowadays to make system calls that actually do what is requested, even if it takes time, rather than annoying the user with low-level sync problems. This is a blocking I/O call, after all...
Usually coders working for bigger companies also have tons of guys like that. Education there really says nothing. It's a mixture of university guys with guys whom with hard work worked their way up. I respect that. Yet both share they have not the intellectual luggage to prove systems correct.
Windows is horrible there, yet whatever you say: it's all very WELL documented, including its features you have to program around. Oh did i quote Bill Gates there? Features rather than bugs... ...gosh my bad.
Oh really, i was thinking you're the type of guy who clears his memory buffer 7 times before deallocating it. Good to know i'm wrong!My size for the buffer was mostly inspired by the idea that a FEN for a 36x36 board could be pretty long, especially if there are so many piece types that most pieces need two letters, and you then need additional delimiters to see which letters form a pair, so that you can need 3 or 4 characters per piece...
The p2p I made is a pure engine, so no graphics thread needed. Normally I do two threads in an adapter, one for each direction of the communication traffic. But here you need to listen for incoming connections too. You don't really need to do that at the same time as handling incoming traffic, but it was a bit difficult to terminate the listening when the stdin thread decides it is time to connect as client to a remote machine. I just hope that printf is thread-safe, because all threads do a lot of printing on stdout.