D
Dmitriy V'jukov
I am trying to figure out difference between memory_order_acq_rel and
memory_order_seq_cst memory order in C++0x.
As I understand memory_order_seq_cst is similar to volatile keyword in
Java, i.e.:
std::atomic_bool b1, b2;
std::atomic_store_explicit(&b1, true, std::memory_order_seq_cst);
// #StoreLoad is emitted by compiler
if (std::atomic_load(&b2, std::memory_order_seq_cst))
//...
Right?
But what is memory_order_acq_rel? And when I need it? Can you provide
some example?
Dmitriy V'jukov
memory_order_seq_cst memory order in C++0x.
As I understand memory_order_seq_cst is similar to volatile keyword in
Java, i.e.:
std::atomic_bool b1, b2;
std::atomic_store_explicit(&b1, true, std::memory_order_seq_cst);
// #StoreLoad is emitted by compiler
if (std::atomic_load(&b2, std::memory_order_seq_cst))
//...
Right?
But what is memory_order_acq_rel? And when I need it? Can you provide
some example?
Dmitriy V'jukov