Re: set_current_state

Ben Pfaff (pfaffben@msu.edu)
06 Sep 1999 13:13:53 -0400


Jamie Lokier <lkd@tantalophile.demon.co.uk> writes:

Andrea Arcangeli wrote:
> >AFAIK the ordering of volatile operations is only defined with respect
> >to each other.
>
> I thought the rule was different.

I'm not absolutely sure. I read once that `volatile' accesses and I/O
function calls are the visible side-effects of a C program, which must
be preserved, and the compiler is free to optimise the rest as it
likes. I think it's a C standard issue.

Yes, it is. From 6.5.3 in the C standard:

...any expression referring to [an object that has volatile-qualified
type] shall be evaluated stricltly according to the rules of the
abstract machine... Furthermore, at every sequence point the value
last stored in the object shall agree with that prescribed by the
abstract machine... What constitutes an access to an object that has
volatile-qualified type is implementation-defined.

That's about all the C standard says about volatile accesses,
actually.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/