[cpp-threads] seq_cst compare_exchange and store-load fencing
Alexander Terekhov
alexander.terekhov at gmail.com
Mon Jan 5 17:57:56 GMT 2009
On Sun, Jan 4, 2009 at 12:44 AM, Paul E. McKenney
<paulmck at linux.vnet.ibm.com> wrote:
> On Sat, Jan 03, 2009 at 04:37:21PM +0100, Alexander Terekhov wrote:
>> Abbreviating too much...
>>
>> All .store(...) below meant to store something nonzero (X and Y are
>> zero initially).
>>
>> On Sat, Jan 3, 2009 at 3:07 PM, Alexander Terekhov
>> <alexander.terekhov at gmail.com> wrote:
>> > On Sat, Jan 3, 2009 at 2:09 AM, Paul E. McKenney
>> > <paulmck at linux.vnet.ibm.com> wrote:
>> >
>> > [... additional 1.10 notes about stunning sec_cst ...]
>> >
>> >> Works for me!
>> >
>> > Finally, I suggest to add rather simple example or two along the lines of
>> >
>> > P1: X.store(relaxed|release); fence(sec_cst); y = Y.load(relaxed|acquire);
>> > P2: Y.store(relaxed|release); fence(sec_cst); x = X.load(relaxed|acquire);
>>
>> P1: X.store(1, relaxed|release); fence(sec_cst); y = Y.load(relaxed|acquire);
>> P2: Y.store(1, relaxed|release); fence(sec_cst); x = X.load(relaxed|acquire);
>
> s/sec_cst/seq_cst/, correct?
Yes.
regards,
alexander.
More information about the cpp-threads
mailing list