mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-20 00:56:39 +08:00
Use thread_local compiler specifics
Much faster then pthread_getspecific() but still a speed regression against the original code. Following are the nps on a bench: Position 454165 454838 455433 tls 441046 442767 442767 ms (Win) 450521 447510 451105 ms (pthread) 422115 422115 424276 Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
@@ -332,7 +332,7 @@ finalize:
|
||||
// but if we are pondering or in infinite search, we shouldn't print the best
|
||||
// move before we are told to do so.
|
||||
if (!Signals.stop && (Limits.ponder || Limits.infinite))
|
||||
Threads.this_thread()->wait_for_stop_or_ponderhit();
|
||||
this_thread->wait_for_stop_or_ponderhit();
|
||||
|
||||
// Best move could be MOVE_NONE when searching on a stalemate position
|
||||
cout << "bestmove " << move_to_uci(RootMoves[0].pv[0], Chess960)
|
||||
@@ -543,7 +543,7 @@ namespace {
|
||||
bool isPvMove, inCheck, singularExtensionNode, givesCheck;
|
||||
bool captureOrPromotion, dangerous, doFullDepthSearch;
|
||||
int moveCount = 0, playedMoveCount = 0;
|
||||
Thread* thisThread = Threads.this_thread();
|
||||
Thread* thisThread = this_thread;
|
||||
SplitPoint* sp = NULL;
|
||||
|
||||
refinedValue = bestValue = value = -VALUE_INFINITE;
|
||||
|
||||
Reference in New Issue
Block a user