Page 1 of 1

OS Independent Winboard/Xboard implementation

PostPosted: 12 Aug 2005, 22:20
by Pradu
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.

Re: OS Independent Winboard/Xboard implementation

PostPosted: 14 Aug 2005, 02:17
by Miguel A. Ballicora
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

Re: OS Independent Winboard/Xboard implementation

PostPosted: 14 Aug 2005, 04:20
by Pradu
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".

Re: OS Independent Winboard/Xboard implementation

PostPosted: 14 Aug 2005, 07:06
by Richard Pijl
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.

Re: OS Independent Winboard/Xboard implementation

PostPosted: 16 Aug 2005, 21:22
by Pradu

Re: OS Independent Winboard/Xboard implementation

PostPosted: 23 Aug 2005, 15:54
by Alvaro Begue
For very portable threads in C++, take a look at the Boost thread library.

Re: OS Independent Winboard/Xboard implementation

PostPosted: 24 Aug 2005, 03:12
by Dann Corbit