atomic accesses
David Daney
ddaney@avtrex.com
Tue Mar 4 00:59:00 GMT 2008
Segher Boessenkool wrote:
> The Linux kernel, and probably some user-space applications and libraries
> as well, depend on GCC guaranteeing (a variant of) the following:
>
> "any access to a naturally aligned scalar object in memory
> that is not a bit-field will be performed by a single machine
> instruction whenever possible"
>
> and it seems the current compiler actually does work like this.
>
> I propose we add this text to the GCC manual (where?), so at least they
> are right if/when they blame us for breaking that promise :-)
>
> Comments? Flames?
>
It seems like a good idea.
This seems somewhat like other issues we have dealt with concerning
thread safety. Perhaps an entire section addressing code generation
issues related to correct multi-threaded semantics.
David Daney
More information about the Gcc
mailing list