basic_string atomicity

David Edelsohn dje.gcc@gmail.com
Wed Jan 11 20:37:00 GMT 2012


On Mon, Jan 9, 2012 at 10:55 AM, Andrew MacLeod <amacleod@redhat.com> wrote:

> We can change libstdc++ to use a less stringent memory model, but we'd have
> to be sure that its correct for *all* platforms... ie, that
> 'exchange_and_add' is really acquire/release and not seq-cst sometimes.
> I expect for the next release to go through everything and remove all
> references to the old __sync routines and replace them with __atomic calls.
>
> Im not really familiar with the atomicity.h stuff,  bkoz has been taking
> care of that, maybe he can chip in here on what the model expected for
> exchange_and_add and others really should be.

Is the concern about the semantics of libstdc++ refcounting or about
adding a new function to __gnu_cxx class?  If the latter, as I suggest
in the PR, we can retain the one function and use ACQUIRE semantics
for addition and RELEASE semantics for subtraction until this
functionality is rewritten for GCC 4.8.

What is the next step and how can we proceed?

Thanks, David

P.S. Yes a final patch using __atomic_fetch_* will use the predefined
macros for memory model names.



More information about the Libstdc++ mailing list