我想知道以下内容:
例如:
std::atomic<uint8_t> i=0;
thr1_func()
{
i.store(1,std::memory_order_relaxed);//here is first step
}
thr1_func()
{
while(!i.load(std::memory_order_relaxed);//here is next step
}
'i'变量在存储操作后的第一次装入操作中将具有新值吗?还是在第二次或其他执行命令时'i'变量可能具有新值?
先谢谢你。
第二个线程在下一次加载操作中看到新值吗?