(side note: I also get [NOT CURRENT] messages when trying to
load_acquire data that has been stored using compare_exchange_strong &
rl::memory_order_seq_cst, but here I'll be investigating it further, I
probably should load it with seq_cst as well, not sure how acquire
load semantics works with seq_cst store).
-- Maciej
Yes, of course. The most well known example is:
//thread 1
x.store(1, std::memory_order_release);
R1 = y.load(std::memory_order_acquire);
//thread 2
y.store(1, std::memory_order_release);
R2 = x.load(std::memory_order_acquire);
The outcome R1==R2==0 is completely possible. However there is no
sequentially consistent executions in which R1==R2==0 is possible.
If you need sequential consistency (no 'non current') then you need to
use seq_cst ordering.
You can find more info on C# memory model (volatile stores/loads are
release/acquire) in Joe Duffy blog:
http://www.bluebytesoftware.com/blog/2008/07/17/LoadsCannotPassOtherLoadsIsAMyth.aspx
http://www.bluebytesoftware.com/blog/2007/11/10/CLR20MemoryModel.aspx
seq_cst ordering works IFF ALL operations are seq_cst (they are seq
consistent regarding each other only). If store is seq_cst and load is
acquire, then I think it effectively equal to store is release and
load is acquire.
--
Dmitriy V'jukov