From 633c83f648893979999b57383cb84534b81c8506 Mon Sep 17 00:00:00 2001 From: Marco Costalba Date: Sun, 24 Apr 2011 08:18:39 +0100 Subject: [PATCH] Document why we use per-thread pawn and material tables Arisen from a discussion on talkchess. No fnctional change. Signed-off-by: Marco Costalba --- src/evaluate.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/evaluate.cpp b/src/evaluate.cpp index 5586d64d..25451da5 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -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]; -- 2.39.2