help-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: What would it take....


From: Samuel Thibault
Subject: Re: What would it take....
Date: Wed, 23 Dec 2009 10:29:19 +0100
User-agent: Mutt/1.5.12-2006-07-14

Samuel Thibault, le Wed 23 Dec 2009 10:26:09 +0100, a écrit :
> Da Zheng, le Wed 23 Dec 2009 16:46:34 +0800, a écrit :
> > > If you use volatile, the compiler won't
> > > optimise instructions so it would "work" too ; note however that it's
> > > not SMP safe (it may even not be premption-safe, depending on which
> > > instruction the compiler eventually uses).
> > We don't need both? If there is only volatile, instructions might be 
> > executed out of order and compilers might also reorder instructions.
> 
> Volatile prevents from compiler reorder.

Oops, sorry, of course not. You need the memory clobber for that. Or use
a function call and not assume that ordering will be correct for local
variables.

Samuel




reply via email to

[Prev in Thread] Current Thread [Next in Thread]