This is the mail archive of the gcc-help@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: __GCC_HAVE_SYNC_COMPARE_AND_SWAP_16 not defined on aarch64


On 28/06/17 18:36, Richard Earnshaw wrote:
> thread2 is blissfully unaware of the fact that by using CAS directly on
> 'a' it has broken the requirement in f() that an object must be locked
> before it can be dereferenced.

I don't undestand, though; wouldn't this be something which falls wholly
to the *user* to get right?  why is the compiler concerned?

If I create a variable which I make thread safe with locks and then in
one case I don't use those locks, this is my problem, not the compilers.

This matter with CAS/locks seems much the same.



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