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: sync operations: where's the barrier?



On 18/04/2005, at 6:13 PM, David Edelsohn wrote:


Geoffrey Keating writes:

Geoff> The documentation for the atomic operation patterns says things like:


This pattern must issue any memory barrier instructions such that the
pattern as a whole acts as a full barrier.

Geoff> Should the barrier happen before the operation, after the operation,
Geoff> are there two barriers, or is it undefined?


On PowerPC, this has a lot to do with the cooperation of the
various functions referencing the memory atomically. I am most familiar
with emitting sync (or lwsync) before the atomic operation.

That's what I'd planned to do, emit sync before the operation; but obviously it does matter, one way lets you use the intrinsic to acquire an object and the other way lets you use the intrinsic to release an object.


(Ideally it would be lwsync; actually, ideally there would be no sync at all, and users would be required to output one if they wanted one; but at present the routines are documented to have a 'sync'. The question is where...)

Attachment: smime.p7s
Description: S/MIME cryptographic signature


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