__GCC_HAVE_SYNC_COMPARE_AND_SWAP_16 not defined on aarch64

Toebs Douglass toby@winterflaw.net
Wed Jun 28 21:22:00 GMT 2017


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.




More information about the Gcc-help mailing list