Communication problem between engine and interface

Programming Topics (Computer Chess) and technical aspects as test techniques, book building, program tuning etc

Moderator: Andres Valverde

Communication problem between engine and interface

Postby Patrice Duhamel » 10 Nov 2007, 22:55

I have a strange problem with the informations sent by my engine to the interface. ("info" command in UCI engine)

on my Pentium IV 3.0GHz (Hyperthreading) it works.
on some other computers, It works... but the result is shown only after the engine has finished to think.

I think this may happens because I'm using a thread to execute the search function ?
I create a thread for the search to be able to receive information from the interface while thinking.

or there is a problem with the function I'm using to communicate with the interface ?
I'm using fgets() on stdin to get command from the interface, and sending information with a fprintf() to stdout,
followed by a fflush() to be sure the command is sent.

someone already had this problem ?
User avatar
Patrice Duhamel
 
Posts: 49
Joined: 03 Dec 2006, 14:27
Location: France

Re: Communication problem between engine and interface

Postby Aleks Peshkov » 10 Nov 2007, 23:05

If you gather incoming commands in one thread and send response to GUI in another thread then you may have problems because your version of stdio library may not be designed to be thread safe.
Aleks Peshkov
 
Posts: 27
Joined: 13 Jul 2007, 13:14

Re: Communication problem between engine and interface

Postby Patrice Duhamel » 11 Nov 2007, 14:14

Thank you, locking the thread before sending output to the interface seems to solve the problem.
User avatar
Patrice Duhamel
 
Posts: 49
Joined: 03 Dec 2006, 14:27
Location: France


Return to Programming and Technical Discussions

Who is online

Users browsing this forum: No registered users and 37 guests