mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-20 17:16:33 +08:00
Don't use do_sleep flag
Rename it is_finished and use it only in main thread to signal search is finished. This allows us to simplify the complex SMP logic. Ultra tricky patch: deep test is required under wide conditions like pondering on and option "Use Sleeping Threads" set to false. No functional change.
This commit is contained in:
@@ -120,7 +120,7 @@ public:
|
||||
SplitPoint* volatile curSplitPoint;
|
||||
volatile int splitPointsCnt;
|
||||
volatile bool is_searching;
|
||||
volatile bool do_sleep;
|
||||
volatile bool is_finished;
|
||||
volatile bool do_exit;
|
||||
};
|
||||
|
||||
@@ -136,7 +136,6 @@ public:
|
||||
void exit(); // be initialized and valid during the whole thread lifetime.
|
||||
|
||||
Thread& operator[](size_t id) { return *threads[id]; }
|
||||
bool use_sleeping_threads() const { return useSleepingThreads; }
|
||||
int min_split_depth() const { return minimumSplitDepth; }
|
||||
size_t size() const { return threads.size(); }
|
||||
Thread* main_thread() { return threads[0]; }
|
||||
@@ -161,7 +160,8 @@ private:
|
||||
ConditionVariable sleepCondition;
|
||||
Depth minimumSplitDepth;
|
||||
int maxThreadsPerSplitPoint;
|
||||
bool useSleepingThreads;
|
||||
public:
|
||||
bool sleepWhileIdle;
|
||||
};
|
||||
|
||||
extern ThreadPool Threads;
|
||||
|
||||
Reference in New Issue
Block a user