bhlangonijr wrote:Concerning the following structures of your chess engine:
- Main Hash Table
- Pawn Hash Table
- Killers array
- History array
How you deal with these structures, when implementing a SMP search? To be more specific: 
 - For what structures, you keep a separate instance for each thread and what structures share a single instance with all threads;
 - How you handle the concurrent access - if applicable - for each of these structures;
 - How to maintain the killers/history arrays.
Thanks,
Hi BH,
I am the least expert here regarding this topic, so I stayed quiet. However, my experience may end up being more useful for you because I am closer to you in developing an SMP engine (I am only a couple of steps ahead). People with a lot of experience forgot what it means to tame this beast 
 
Whatever you do, keep it simple and robust and keep the bugs out of the implementation. Design something that is not very complicated. Later, you can move forward. 
You need a way to keep track what the search is doing at the beginning, dumping to a log all the decisions of a shallow search. 
So, I will give you an advice that goes AGAINST everything said here. Lock all the tables with mutexes and/or spinlocks. Yes, that is slower, but you will know that you **won't** be chasing ghosts when you debug this. Once the bugs are out, replace those mutexes with all the advices you got here, but not before! I see replacing mutexes with nothing or lockless systems as an optimization technique. Optimization should never precede a bug-free implementation of a straightforward design. The point is, you have to get to know the search. You can't optimize this before learning how to do it.
In Gaviota I removed all the mutexes and I use a lockless procedure. Not because it is needed, but because it will help me to keep the code with fewer bugs possible. One day, I may even remove that.
For now, In Gaviota, only the killers are local to each thread. I found they really need to be that way.The main hashtable needs to be shared. I think that the rest is a matter of taste. Do whatever it will give you less headaches. Only you know what that would be 
 
Miguel