Re: [powerpc64le] seq_cst memory order possibly not honored

2015-08-14 Thread David Edelsohn
On Fri, Aug 14, 2015 at 8:20 AM, Andrey Semashev wrote: > On 14.08.2015 13:19, Jonathan Wakely wrote: >> >> On 14 August 2015 at 10:54, Andrey Semashev >> wrote: >> >>> Otherwise I cannot see how (x==0 && y==0) could happen. The last load in >>> each thread is sequenced after the first seq_cst st

Re: [powerpc64le] seq_cst memory order possibly not honored

2015-08-14 Thread Andrey Semashev
On 14.08.2015 13:19, Jonathan Wakely wrote: On 14 August 2015 at 10:54, Andrey Semashev wrote: Otherwise I cannot see how (x==0 && y==0) could happen. The last load in each thread is sequenced after the first seq_cst store and both stores are ordered with respect to each other, so one of the t

Re: [powerpc64le] seq_cst memory order possibly not honored

2015-08-14 Thread Jonathan Wakely
On 14 August 2015 at 10:54, Andrey Semashev wrote: > On 14.08.2015 11:51, Jonathan Wakely wrote: >> >> On 14 August 2015 at 01:37, Andrey Semashev wrote: >>> >>> 1. Is my test valid or is there a flaw that I'm missing? >> >> >> The cppmem tool at http://svr-pes20-cppmem.cl.cam.ac.uk/cppmem/ shows

Re: [powerpc64le] seq_cst memory order possibly not honored

2015-08-14 Thread Andrey Semashev
On 14.08.2015 11:51, Jonathan Wakely wrote: On 14 August 2015 at 01:37, Andrey Semashev wrote: 1. Is my test valid or is there a flaw that I'm missing? The cppmem tool at http://svr-pes20-cppmem.cl.cam.ac.uk/cppmem/ shows that there are consistent executions where (x==0 && y==0) is true. I use

Re: [powerpc64le] seq_cst memory order possibly not honored

2015-08-14 Thread Jonathan Wakely
On 14 August 2015 at 01:37, Andrey Semashev wrote: > 1. Is my test valid or is there a flaw that I'm missing? The cppmem tool at http://svr-pes20-cppmem.cl.cam.ac.uk/cppmem/ shows that there are consistent executions where (x==0 && y==0) is true. I used this code: int main() { atomic_int a = 0;

[powerpc64le] seq_cst memory order possibly not honored

2015-08-13 Thread Andrey Semashev
Hi, I'm having a problem with one of the Boost.Atomic tests on a PowerPC64 LE test platform. The test is running two threads which are looping code like this: Thread 1 Thread 2 [initially a == 0 && b == 0] a.store(1, seq_cst); b.store(1, seq_cst); a.load(relaxed);