1
0
Fork 0

Fix some races in learning

declare a few variables atomic.

Other races remain...
pull/3472/head
Joost VandeVondele 2020-09-18 23:06:45 +02:00 committed by nodchip
parent e8472b5fbe
commit 61bc8d12d3
1 changed files with 3 additions and 3 deletions

View File

@ -695,14 +695,14 @@ namespace Learner
uint64_t last_done;
// If total_read exceeds this value, update_weights() and calculate mse.
uint64_t next_update_weights;
std::atomic<uint64_t> next_update_weights;
uint64_t save_count;
// Do not shuffle when reading the phase.
bool no_shuffle;
bool stop_flag;
std::atomic<bool> stop_flag;
vector<Key> hash;
@ -785,7 +785,7 @@ namespace Learner
// Mini batch size size. Be sure to set it on the side that uses this class.
uint64_t mini_batch_size = LEARN_MINI_BATCH_SIZE;
bool stop_flag;
std::atomic<bool> stop_flag;
// Discount rate
double discount_rate;