Subject: Re: [boost] [atomic] Probable documentation issue: how do weknowatomic is safe and/or efficient?
From: Andrey Semashev (andrey.semashev_at_[hidden])
Date: 2013-12-25 08:16:55
On Wed, Dec 25, 2013 at 5:12 PM, Rob Stewart <robertstewart_at_[hidden]> wrote:
> On Dec 25, 2013, at 7:47 AM, Andrey Semashev <andrey.semashev_at_[hidden]> wrote:
>> On Wed, Dec 25, 2013 at 4:40 PM, Rob Stewart <robertstewart_at_[hidden]> wrote:
>>> On Dec 24, 2013, at 2:24 PM, Andrey Semashev <andrey.semashev_at_[hidden]> wrote:
>>>>> So does this mean that Boost.Atomic is perhaps not safe after all?
>>>> No, it's perfectly safe on x86. It is also safe on ARM if /volatile:ms is specified.
>>> How do you ensure the use of /volatile:ms? Can users build Boost with /volatile:iso?
>> You can't, I was just answering John's question.
> You used the phrase, "perfectly safe," which suggested that /volatile:ms was somehow ensured on x86.
x86 guarantees correct memory view, except for very specific
operations. And compiler barriers in the code guarantee that the
actual instructions are generated in the right order. So yes,
regardless of the /volatile:ms switch, on x86 it works as intended.