Using C++11+ in hotspot
Martin Buchholz
martinrb at google.com
Wed Aug 8 20:05:01 UTC 2018
On Wed, Aug 8, 2018 at 7:02 AM, Andrew Haley <aph at redhat.com> wrote:
> On 08/08/2018 07:51 AM, Erik Osterlund wrote:
>
> > So basically, my answer to your question is: no we do not and should
> > not care. And that message ought to be documented somewhere to
> > remove all uncertainty and inconsistency around that reoccuring
> > question.
>
> That sounds sensible. I guess that if we use -fno-strict-aliasing
> then we can cast *T to *atomic<T>. I can ask on gcc@ to be sure.
>
A difficulty might arise if the representation of atomic<T> is different
from T, as might happen if the arch has no atomic instructions for a type
of that size and so a lock must be allocated somewhere. I don't know how
gcc's atomic builtins deal with that problem.
More information about the workshop-discuss
mailing list