]> git.sesse.net Git - stockfish/blobdiff - src/tt.h
Reduce SMP contention on TT
[stockfish] / src / tt.h
index c570761bdec0fd91120fe99a28b1b18f562c7bcc..fb414bf157aeba9fa98fbe70bbb728cd27445e1e 100644 (file)
--- a/src/tt.h
+++ b/src/tt.h
@@ -92,7 +92,13 @@ public:
 private:
   inline TTEntry* first_entry(const Key posKey) const;
 
-  unsigned size, writes;
+  // Be sure 'writes' is at least one cacheline away
+  // from read only variables.
+  unsigned char pad_before[64 - sizeof(unsigned)];
+  unsigned writes; // heavy SMP read/write access here
+  unsigned char pad_after[64];
+
+  unsigned size;
   TTEntry* entries;
   uint8_t generation;
 };