Quantcast
Channel: atomic load store with memory order - Stack Overflow
Viewing all articles
Browse latest Browse all 3

atomic load store with memory order

$
0
0

Thread A runs x.store(1, std::memory_order_release) first, then thread B runs x.load(std::memory_order_acquire).x in thread B is not guaranteed to read 1 stored by A.

If I use memory_order_seq_cst, will it be guaranteed to read 1?


Viewing all articles
Browse latest Browse all 3

Latest Images

Trending Articles





Latest Images