+ std::vector<std::thread> threads;
+
+ for (size_t idx = 0; idx < Options["Threads"]; ++idx)
+ {
+ threads.emplace_back([this, idx]() {
+
+ // Thread binding gives faster search on systems with a first-touch policy
+ if (Options["Threads"] > 8)
+ WinProcGroup::bindThisThread(idx);
+
+ // Each thread will zero its part of the hash table
+ const size_t stride = size_t(clusterCount / Options["Threads"]),
+ start = size_t(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();