mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-24 19:16:49 +08:00
Start sfen reader worker thread in the constructor.
This commit is contained in:
@@ -490,9 +490,6 @@ namespace Learner
|
||||
|
||||
Eval::NNUE::verify_any_net_loaded();
|
||||
|
||||
// Start a thread that loads the training data in the background
|
||||
sr.start_file_read_worker();
|
||||
|
||||
const PSVector sfen_for_mse =
|
||||
validation_set_file_name.empty()
|
||||
? sr.read_for_mse(sfen_for_mse_size)
|
||||
|
||||
@@ -53,6 +53,10 @@ namespace Learner{
|
||||
end_of_files = false;
|
||||
shuffle = true;
|
||||
stop_flag = false;
|
||||
|
||||
file_worker_thread = std::thread([&] {
|
||||
this->file_read_worker();
|
||||
});
|
||||
}
|
||||
|
||||
~SfenReader()
|
||||
@@ -176,14 +180,6 @@ namespace Learner{
|
||||
|
||||
}
|
||||
|
||||
// Start a thread that loads the phase file in the background.
|
||||
void start_file_read_worker()
|
||||
{
|
||||
file_worker_thread = std::thread([&] {
|
||||
this->file_read_worker();
|
||||
});
|
||||
}
|
||||
|
||||
void file_read_worker()
|
||||
{
|
||||
std::string currentFilename;
|
||||
|
||||
Reference in New Issue
Block a user