Volatile is Necessary
Walter Bays
walter at garth.UUCP
Tue Mar 29 08:10:24 AEST 1988
In article <8107 at sol.ARPA> crowl at cs.rochester.edu (Lawrence Crowl) writes:
>The `volatile' type qualifier of ANSI C has recently been criticized as a
>frill. While this assertion is arguable for uniprocessors, it is not true for
>shared-memory multiprocessors. [...] If there is no mechanism to
>indicate when a variable referenced by one process may be modified by
>another process, the compiler must assume that all variables may be
>modified at any time. [...] This limits the optimizing effectiveness
>of compilers substantially. [...]
The 'volatile' keyword would also work for uniprocessor device
drivers. How about setjmp()? Or side effects of functions with
"dangerous" pointers?
--
------------------------------------------------------------------------------
Any similarities between my opinions and those of the
person who signs my paychecks is purely coincidental.
E-Mail route: ...!pyramid!garth!walter
USPS: Intergraph APD, 2400 Geng Road, Palo Alto, California 94303
Phone: (415) 852-2384
------------------------------------------------------------------------------
More information about the Comp.lang.c
mailing list