rewrite generating a new chess project

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

Dann Corbit
Posts: 12540
Joined: Wed Mar 08, 2006 8:57 pm
Location: Redmond, WA USA

Re: rewrite generating a new chess project

Post by Dann Corbit »

Sven wrote: Sat Nov 03, 2018 11:40 am Jumbo is written in C++. It has zero (0) global variables.
Surely your hashtable is shared?
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.
Sven
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

Post by Sven »

Dann Corbit wrote: Mon Nov 05, 2018 8:19 pm
Sven wrote: Sat Nov 03, 2018 11:40 am Jumbo is written in C++. It has zero (0) global variables.
Surely your hashtable is shared?
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)
Henk
Posts: 7218
Joined: Mon May 27, 2013 10:31 am

Re: rewrite generating a new chess project

Post by Henk »

Dann Corbit wrote: Mon Nov 05, 2018 8:19 pm
Sven wrote: Sat Nov 03, 2018 11:40 am Jumbo is written in C++. It has zero (0) global variables.
Surely your hashtable is shared?
If it does not use dependency injection then it is bad code. Not maintainable, testable and more.
Sven
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

Post by Sven »

Henk wrote: Wed Nov 07, 2018 12:22 am
Dann Corbit wrote: Mon Nov 05, 2018 8:19 pm
Sven wrote: Sat Nov 03, 2018 11:40 am Jumbo is written in C++. It has zero (0) global variables.
Surely your hashtable is shared?
If it does not use dependency injection then it is bad code. Not maintainable, testable and more.
Irony detector has been triggered.
Sven Schüle (engine author: Jumbo, KnockOut, Surprise)