Surely your hashtable is shared?
rewrite generating a new chess project
Moderators: hgm, Rebel, chrisw
-
- Posts: 12541
- Joined: Wed Mar 08, 2006 8:57 pm
- Location: Redmond, WA USA
Re: rewrite generating a new chess project
Taking ideas is not a vice, it is a virtue. We have another word for this. It is called learning.
But sharing ideas is an even greater virtue. We have another word for this. It is called teaching.
But sharing ideas is an even greater virtue. We have another word for this. It is called teaching.
-
- Posts: 4052
- Joined: Thu May 15, 2008 9:57 pm
- Location: Berlin, Germany
- Full name: Sven Schüle
Re: rewrite generating a new chess project
Of course. Each search thread (more precisely: each "Searcher" instance of which there is exactly one per search thread) holds a reference to the shared TT hash table as a private member. That TT hash table instance is created and owned by the "ChessPlayer" instance that starts the required number of search threads and passes a TTHash reference to each thread. So "shared" is not necessarily the same as "exists in the global scope".
Sven Schüle (engine author: Jumbo, KnockOut, Surprise)
-
- Posts: 7220
- Joined: Mon May 27, 2013 10:31 am
Re: rewrite generating a new chess project
If it does not use dependency injection then it is bad code. Not maintainable, testable and more.
-
- Posts: 4052
- Joined: Thu May 15, 2008 9:57 pm
- Location: Berlin, Germany
- Full name: Sven Schüle
Re: rewrite generating a new chess project
Irony detector has been triggered.Henk wrote: ↑Wed Nov 07, 2018 12:22 amIf it does not use dependency injection then it is bad code. Not maintainable, testable and more.
Sven Schüle (engine author: Jumbo, KnockOut, Surprise)