-/// TranspositionTable::probe() looks up the current position in the
-/// transposition table. It returns true and a pointer to the TTEntry if
-/// the position is found. Otherwise, it returns false and a pointer to an empty or
-/// least valuable TTEntry to be replaced later. A TTEntry t1 is considered
-/// to be more valuable than a TTEntry t2 if t1 is from the current search and t2
-/// is from a previous search, or if the depth of t1 is bigger than the depth of t2.
+ // Each thread will zero its part of the hash table
+ const size_t stride = clusterCount / Options["Threads"],
+ start = stride * idx,
+ len = idx != Options["Threads"] - 1 ?
+ stride : clusterCount - start;
+
+ std::memset(&table[start], 0, len * sizeof(Cluster));
+ }));
+ }
+
+ for (std::thread& th: threads)
+ th.join();
+}
+
+/// TranspositionTable::probe() looks up the current position in the transposition
+/// table. It returns true and a pointer to the TTEntry if the position is found.
+/// Otherwise, it returns false and a pointer to an empty or least valuable TTEntry
+/// to be replaced later. The replace value of an entry is calculated as its depth
+/// minus 8 times its relative age. TTEntry t1 is considered more valuable than
+/// TTEntry t2 if its replace value is greater than that of t2.