【发布时间】:2018-10-22 10:13:32
【问题描述】:
线程A首先运行x.store(1, std::memory_order_release),
然后线程 B 运行x.load(std::memory_order_acquire)。
线程 B 中的x 不保证读取 A 存储的 1。
如果我用memory_order_seq_cst,能保证读到1吗?
【问题讨论】:
标签: c++ multithreading thread-safety memory-model stdatomic