Start sfen reader worker thread in the constructor.

This commit is contained in:
Tomasz Sobczyk
2020-10-22 14:43:38 +02:00
committed by nodchip
parent 0636e1256d
commit c58aa9696a
2 changed files with 4 additions and 11 deletions

View File

@@ -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)

View File

@@ -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;