]> git.sesse.net Git - stockfish/commitdiff
Document why we use per-thread pawn and material tables
authorMarco Costalba <mcostalba@gmail.com>
Sun, 24 Apr 2011 07:18:39 +0000 (08:18 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Sun, 24 Apr 2011 07:18:39 +0000 (08:18 +0100)
Arisen from a discussion on talkchess.

No fnctional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
src/evaluate.cpp

index 5586d64d0315ac1c68acd70103a5bd1bd44b823b..25451da5211aef741986626c52552a5a2d7fdff9 100644 (file)
@@ -233,7 +233,9 @@ namespace {
   };
 
   // Pawn and material hash tables, indexed by the current thread id.
-  // Note that they will be initialized at 0 being global variables.
+  // We use per-thread tables so that once we get a pointer to an entry
+  // its life time is unlimited and we don't have to care about someone
+  // changing the entry under our feet.
   MaterialInfoTable* MaterialTable[MAX_THREADS];
   PawnInfoTable* PawnTable[MAX_THREADS];