////
struct SplitPoint {
- SplitPoint *parent;
+
+ // Const data after splitPoint has been setup
+ SplitPoint* parent;
const Position* pos;
- SearchStack sstack[MAX_THREADS][PLY_MAX_PLUS_2];
- SearchStack *parentSstack;
- int ply;
- Depth depth;
- volatile Value alpha, beta, bestValue;
- Value futilityValue;
bool pvNode;
- int master, slaves[MAX_THREADS];
+ Depth depth;
+ Value beta, futilityValue;
+ int ply, master, slaves[MAX_THREADS];
+ SearchStack sstack[MAX_THREADS][PLY_MAX_PLUS_2];
+
+ // Const pointers to shared data
+ MovePicker* mp;
+ SearchStack* parentSstack;
+
+ // Shared data
Lock lock;
- MovePicker *mp;
+ volatile Value alpha;
+ volatile Value bestValue;
volatile int moves;
volatile int cpus;
- bool finished;
+ volatile bool stopRequest;
};
// ThreadState type is used to represent thread's current state
};
struct Thread {
- SplitPoint *splitPoint;
+ SplitPoint* splitPoint;
volatile int activeSplitPoints;
uint64_t nodes;
uint64_t betaCutOffs[2];
- volatile bool stopRequest;
volatile bool printCurrentLineRequest;
volatile ThreadState state;
unsigned char pad[64]; // set some distance among local data for each thread