Does a relaxed memory-order spinlock always break synchronization?

前端 未结 0 704
误落风尘
误落风尘 2021-01-02 00:12

Consider the following code:

int nonatom = 0;
std::atomic atom{0};

// thread 1
nonatom = 1;
atom.store(1, std::memory_order_release);

// thread 2         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题