We want to keep three loosely-coupled modules in GNU Chess v6:
The main program contains the frontend and starts two addtional threads, one for the adapter, and another one for the engine. The three components comprise a chain, thus there are two links:
The links are based on pipes. There is no need for additional synchronization mechanisms such as mutex. The changes in PolyGlot and Fruit are minimal, since they were already using the same mechanism to communicate with each other.
Another technical problem was the fact that GNU Chess v5 was written in C, whereas PolyGlot and Fruit are written in C++. In GNU Chess v6 the main program, the adapter and the engine are in C++, but the frontend remains in C.
Source code was placed under a single src in GNU Chess v5, as usual. Three additional directories have been created for GNU Chess v6, so the code is organized in four directories:
The sources in each src subdirectory are compiled as a static library. When link with the sources in top src, they result into the binary gnuchess. The module libraries are named after their respective directory name:
libfrontend.a libadapter.a libengine.a