]> git.sesse.net Git - stockfish/blobdiff - src/thread.h
Improve smp performance for high number of threads
[stockfish] / src / thread.h
index 9750ed7ba020be8008007f482f7ab9e146e4c9dd..949f87ad28ae086fe75e0577b98e859029cfc4ed 100644 (file)
@@ -33,6 +33,7 @@ struct Thread;
 
 const int MAX_THREADS = 128;
 const int MAX_SPLITPOINTS_PER_THREAD = 8;
+const int MAX_SLAVES_PER_SPLITPOINT = 4;
 
 /// Mutex and ConditionVariable struct are wrappers of the low level locking
 /// machinery and are modeled after the corresponding C++11 classes.
@@ -72,6 +73,7 @@ struct SplitPoint {
   const Position* pos;
   Search::Stack* ss;
   Thread* masterThread;
+  int spLevel;
   Depth depth;
   Value beta;
   int nodeType;
@@ -84,6 +86,7 @@ struct SplitPoint {
   // Shared variable data
   Mutex mutex;
   std::bitset<MAX_THREADS> slavesMask;
+  int slavesCount;
   volatile bool allSlavesSearching;
   volatile uint64_t nodes;
   volatile Value alpha;