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:
Marco Costalba
2013-01-13 18:38:44 +01:00
parent 99ae47716a
commit e70eae2c91
4 changed files with 20 additions and 32 deletions

View File

@@ -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;