This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: atomic_thread_fence() semantics


On 19/10/17 14:04, Sebastian Huber wrote:
> On 19/10/17 14:18, Andrew Haley wrote:
>> On 19/10/17 13:10, Jonathan Wakely wrote:
>>> There are no atomic operations on atomic objects here, so the fence
>>> doesn't synchronize with anything.
>> Really?  This seems rather unhelpful, to say the least.
>>
>> An atomic release operation X in thread A synchronizes-with an acquire
>> fence F in thread B, if
>>
>>      there exists an atomic read Y (with any memory order)
>>      Y reads the value written by X (or by the release sequence headed by X)
>>      Y is sequenced-before F in thread B
>>
>> In this case, all non-atomic and relaxed atomic stores that
>> happen-before X in thread A will be synchronized-with all non-atomic
>> and relaxed atomic loads from the same locations made in thread B
>> after F.
> 
> Where is the acquire fence or a load in the example?

In another thread.  :-)

-- 
Andrew Haley
Java Platform Lead Engineer
Red Hat UK Ltd. <https://www.redhat.com>
EAC8 43EB D3EF DB98 CC77 2FAD A5CD 6035 332F A671


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]