C++0x Memory model and gcc
Jean-Marc Bourguet
jm@bourguet.org
Sat May 8 14:38:00 GMT 2010
> -fmemory-model=single
> Assume single threaded execution, which also means no signal
> handlers.
> -fmemory-model=fast
> The user is responsible for all synchronization. Accessing
> the same memory words from different threads may break
> unpredictably.
> -fmemory-model=safe
> The compiler will do its best to protect you.
With that description, I'd think that "safe" lets the user code assumes
the sequential consistency model. I'd use -fmemory-model=conformant or
something like that for the model where the compiler assumes that the user
code respect the constraint led out for it by the standard. As which
constraints are put on user code depend on the languages -- Java has its
own memory model which AFAIK is more constraining than C++ and I think Ada
has its own but my Ada programming days are too far for me to comment on
it -- one may prefer some other name.
Yours,
--
Jean-Marc Bourguet
More information about the Gcc
mailing list