OS Independent Winboard/Xboard implementation

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

Moderator: Andres Valverde

OS Independent Winboard/Xboard implementation

Postby Pradu » 12 Aug 2005, 22:20

Does anyone know an OS independant C implementation of the Winboard/Xboard protocol in such a way that an engine takes commands while searching?

Methods using polling or threads seem to be OS dependant.

Yes it it possible to use #ifdef's and such but I'm am talking about a single exe working on most Operating Systems.
User avatar
Pradu
 
Posts: 343
Joined: 12 Jan 2005, 19:17
Location: Chandler, Arizona, USA

Re: OS Independent Winboard/Xboard implementation

Postby Miguel A. Ballicora » 14 Aug 2005, 02:17

Does anyone know an OS independant C implementation of the Winboard/Xboard protocol in such a way that an engine takes commands while searching?

Methods using polling or threads seem to be OS dependant.

Yes it it possible to use #ifdef's and such but I'm am talking about a single exe working on most Operating Systems.


No, in portable C, there is no way to take commands while the engine is searching. The only way would be with some extensions of the language. Therefore, you need compilers that have the same extensions for the OS's that you are targeting your program. Maybe if you use Cygwin and GCC for windows and Linux? But there is no way that you may find a way to do it truly OS independant.

I am using threads. They are not really portable, but you can do it in a way that you have very few different lines of code.

Miguel
User avatar
Miguel A. Ballicora
 
Posts: 160
Joined: 03 Aug 2005, 02:24
Location: Chicago, IL, USA

Re: OS Independent Winboard/Xboard implementation

Postby Pradu » 14 Aug 2005, 04:20

Miguel A. Ballicora wrote:I am using threads. They are not really portable, but you can do it in a way that you have very few different lines of code.
Miguel


Thanks for the advice Miguel. I guess I'll redirect my efforts to looking for a thread library that does all the #ifdef's required for multiple OS's ... otherwise I"ll have to do this myself :?. I'll probably have to write my own thread library or use something similar to MIT's gthread.h or garp_run_thread.hh I do realize it would be easier to make polling portable, but threads are more useful because they could also be used if your engine was going "deep".
Last edited by Pradu on 14 Aug 2005, 20:28, edited 1 time in total.
User avatar
Pradu
 
Posts: 343
Joined: 12 Jan 2005, 19:17
Location: Chandler, Arizona, USA

Re: OS Independent Winboard/Xboard implementation

Postby Richard Pijl » 14 Aug 2005, 07:06

You might try it using a separate input thread using the POSIX thread library. It won't take away the need for #ifdef's now and then, but no more MS-Windows SDK calls at least ...
Richard.
User avatar
Richard Pijl
 
Posts: 105
Joined: 26 Sep 2004, 21:09
Location: Minderhout, Belgium

Re: OS Independent Winboard/Xboard implementation

Postby Pradu » 16 Aug 2005, 21:22

User avatar
Pradu
 
Posts: 343
Joined: 12 Jan 2005, 19:17
Location: Chandler, Arizona, USA

Re: OS Independent Winboard/Xboard implementation

Postby Alvaro Begue » 23 Aug 2005, 15:54

For very portable threads in C++, take a look at the Boost thread library.
Alvaro Begue
 
Posts: 33
Joined: 03 Aug 2005, 23:48
Location: Stony Brook, New York, U.S.A.

Re: OS Independent Winboard/Xboard implementation

Postby Dann Corbit » 24 Aug 2005, 03:12

Dann Corbit
 


Return to Programming and Technical Discussions

Who is online

Users browsing this forum: No registered users and 43 guests