Comments (9)
This can also be an attempt to do multi-threaded minimax with a thread pool similar to the gene pool structure for starting simultaneous games.
Might also be a good idea to create a Thread_Pool class to handle both these cases.
from genetic_chess.
Not a Thread_Pool, but a Thread_Assembly_Line. A push_back
method creates a new std::future
which is put into an ordered container. This method blocks if there are no processes available to start it. The function passed to push_back()
is run within a lambda that also locks and releases one of a set of mutexes to limit the number of simultaneous threads. Perhaps the mutexes can be put in a queue that blocks when something tries to grab a mutex when it is empty.
from genetic_chess.
For that last bit, use std::counting_semaphore
.
Actually, use std::counting_semaphore
in the current implementation of the gene pool to see how it simplifies the simultaneous game limit.
from genetic_chess.
Simpler still: create a structure that acts like a ticketing system. Before starting a thread, take a ticket. Have the thread release the ticket when it finishes. This will be implemented in a class that wraps a std::condition_variable
for master. In c++20, that class will be deleted and replaced with a std::counting_semaphore
.
from genetic_chess.
Thread limiter implemented here: 36dd6fc
Work ongoing in multi-threaded-minimax branch
from genetic_chess.
Full-minimax search on depth 2 moves is very slow due to having to traverse so much more of the game tree. Reduce this to depth one, maybe with a shared Alpha/Beta values.
from genetic_chess.
More importantly, the engine crashes while doing multi-threaded search. The location of the crash is usually random with memory locations indicating destructed data or out-of-bounds access. Investigating ...
from genetic_chess.
All data sent to threads is now copied as of commit 2d4062b
The multi-threading was reduced to depth one moves due to slowness induced by so much searching caused by the lessened effectiveness of alpha-beta pruning due to starting with new windows with every thread. The branch is fully functional and waiting to be merged.
from genetic_chess.
Threads can now be used in gene pools as of eda7239
from genetic_chess.
Related Issues (20)
- Investigate libchess performance and code
- LaTeX documentation out of date
- Remove blocking piece counting from Castling Possible Gene
- Try removing normalizing of most gene values HOT 1
- Allow for gene sorting and disabling HOT 2
- Use moving average rather than cumulative percentages for game ending and game opening plots
- Remove mutable from Minimax_AI search cache HOT 1
- Move sorter partitioning HOT 1
- Fix PGN reading and writing
- Add noise to evaluations HOT 3
- Replace nested array of all moves with a move generator in each piece HOT 3
- Enlarged board for outside board detection HOT 3
- Game analysis scripts slow due to reading game file multiple times HOT 1
- Replace `Square` index member with rank and file HOT 1
- Mark genome with most wins in gene plots HOT 1
- Incorrect semicolon comment removal
- Add blank line between PGN headers and game text HOT 1
- Try probabilistic mode of disabling genes HOT 2
- PGN parser does not handle % at the beginning of a line HOT 1
- Check whether reversing file-first/rank-first ordering/indexing makes a speed difference
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from genetic_chess.