basil00 / Fathom

Syzygy TB probe tool.
MIT License
17 stars 26 forks source link

Not thread-safe when probing root? #13

Open jdart1 opened 8 years ago

jdart1 commented 8 years ago

The library seems to have problems when multiple threads call tb_probe_root (memory corruption). In my engine this is not done during a normal search, but there are some cases in which it is done (the parameter tuning utility for example can launch multiple threads, each of which does a root probe).

basil00 commented 8 years ago

Yep, not thread safe. It says so in the header documentation:

 * - This function is NOT thread safe.  For engines this function should only
 *   be called once at the root per search.

The original code from this was based is also not thread safe at the root. I haven't looked into what is required to fix this.