mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-20 17:16:33 +08:00
Add support for node limited search
Handle also the SMP case. This has been quite tricky, not trivial to enforce the node limit in SMP case becuase with "helpful master" concept we can have recursive split points and we cannot lock them all at once so there is the risk of counting the same nodes more than once. Anyhow this patch should be race free and counted nodes are correct. No functional change.
This commit is contained in:
@@ -75,6 +75,7 @@ struct SplitPoint {
|
||||
|
||||
// Shared data
|
||||
Mutex mutex;
|
||||
Position* activePositions[MAX_THREADS];
|
||||
volatile uint64_t slavesMask;
|
||||
volatile int64_t nodes;
|
||||
volatile Value alpha;
|
||||
@@ -153,6 +154,7 @@ public:
|
||||
Depth depth, Move threatMove, int moveCount, MovePicker* mp, int nodeType);
|
||||
private:
|
||||
friend class Thread;
|
||||
friend void check_time();
|
||||
|
||||
std::vector<Thread*> threads;
|
||||
Thread* timer;
|
||||
|
||||
Reference in New Issue
Block a user