volatile (in comp.lang.c)

Dieter Woerz woerz at iaoobelix.UUCP
Tue May 10 06:15:00 AEST 1988


In article <1001 at ima.ISC.COM> johnl at ima.UUCP (John R. Levine) writes:
> ...
>The problem is that volatile means many different things to different people.
>For some people it means a memory-like device register.  For others, it means
>shared memory that might be modified by another process, or memory that might
>be modified by an interrupt routine or by the operating system.  Some
>optimists even hope that something like this:
> ...
>could be used for synchronization of shared memory areas.
>
>All of these are useful, and all of them are different.

I don't think, that these are different. They have all one thing in com-
mon, in all cases, the compiler should not cache the value he has read
some time ago from the memory, or in the case of write accesses, the value
should be not be stored in a register. So, in all of the cases men-
tioned above, the value to be read could be modified by some external
"process" (device, other process writing into shared memory, interrupt
routine, ...) or it should immediately modifify a memory location, so that
another "process" is notified of the change.

------------------------------------------------------------------------------

Dieter Woerz
Fraunhofer Institut fuer Arbeitswirtschaft und Organisation
Abt. 453
Holzgartenstrasse 17
D-7000 Stuttgart 1
W-Germany

BITNET: iaoobel.uucp!woerz at unido.bitnet
UUCP:   ...{uunet!unido, pyramid}!iaoobel!woerz



More information about the Comp.lang.c mailing list