mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-20 00:56:39 +08:00
Introduce ThreadsManager class
Main aim of this patch is to consolidate all the thread related stuff behind a single class interface so to avoid messing with global flags and having thread code scattered among non-thread related stuff. Another advantage is that now access to thread's variables is more controlled, in particular we can differentiate between read and write accesses by the mean of different interfaces, it is so simpler to understand how a function is related to threads. Lastly this rewrite is the base for future code consolidations and semplifications that are easier now that we have only one thread's access point. No functional change. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
883
src/search.cpp
883
src/search.cpp
File diff suppressed because it is too large
Load Diff
@@ -66,9 +66,6 @@ struct SplitPoint {
|
||||
|
||||
|
||||
struct Thread {
|
||||
|
||||
Thread() { memset(this, 0, sizeof(Thread)); }
|
||||
|
||||
SplitPoint *splitPoint;
|
||||
volatile int activeSplitPoints;
|
||||
uint64_t nodes;
|
||||
@@ -78,7 +75,7 @@ struct Thread {
|
||||
volatile bool idle;
|
||||
volatile bool sleeping;
|
||||
volatile bool workIsWaiting;
|
||||
volatile bool printCurrentLine;
|
||||
volatile bool printCurrentLineRequest;
|
||||
unsigned char pad[64]; // set some distance among local data for each thread
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user