This is the mail archive of the
mailing list for the GCC project.
Re: question on volatile
Quoting Richard Henderson (firstname.lastname@example.org):
> On Fri, Nov 05, 1999 at 11:29:51AM +0100, Martin Kahlert wrote:
> > how can i be sure, that the compiler doesn't compile
> > it [ by rearranging stores ]
> > Is it enough to make the runme field inside Arguments volatile?
> For the compiler, yes, for the hardware, it depends.
> Does your hardware guarantee total memory ordering?
> Many do not.
Sorry to ask, but what exactly does total memory ordering mean?
When the compiler wrote all of its instructions to write
some data and (hopefully after that) writes to the
volatile variable, what can go wrong? Can the hardware delay
some writes in favor of others?
The early bird gets the worm. If you want something else for
breakfast, get up later.