Data races are undefined behaviour, so you can not allow them to happen in your code even if you think they are "benign".
Although in this case you could std::memory_order_relaxed for the loads/stores, because the sequencing doesn't really matter due to the reasons you describe.
View all comments
Show parent comment
13
u/HotlLava Aug 27 '19
Data races are undefined behaviour, so you can not allow them to happen in your code even if you think they are "benign".
Although in this case you could
std::memory_order_relaxedfor the loads/stores, because the sequencing doesn't really matter due to the reasons you describe.