Subject: Re: [boost] [interprocess] atomic_write32 on GCC/x86/x68_64 lacks memory barrier
From: Peter Dimov (lists_at_[hidden])
Date: 2014-08-11 10:17:08
Lars HagstrÃ¶m wrote:
> Does that "memory" statement at the end add a fence both before and after
> the assembly statement?
Effectively. To be more precise, it turns the assembly statement into a
compiler fence. "memory" tells the compiler to assume that the assembly code
accesses and modifies memory in unpredictable ways, and the effect of that
is basically a compiler fence.
You should probably use the __asm__ and __volatile__ spellings as a matter
of style though.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk