Volatile is Necessary

Per Fogelstr|m pf at diab.UUCP
Tue Mar 29 17:31:23 AEST 1988


In article <7569 at brl-smoke.ARPA> gwyn at brl.arpa (Doug Gwyn (VLD/VMB) <gwyn>) writes:
>In article <8107 at sol.ARPA> crowl at cs.rochester.edu (Lawrence Crowl) writes:
>>shared-memory multiprocessors.  Processes on such machines communicate via
>>updates to a shared variables.
>
>You need a hell of a lot more than "volatile" to properly
>synchronize concurrent processes.

I don't beleive that "volatile" was intended to be a mechanisim for
processor synchronization, rather a way to indicate that a "memory"
location has side effects, for example when it's read. For those of
You that don't normally do system and driver programming it's qite
meaningless, but boy how nice it is to be able to use the -O switch
when compiling a driver wich requires fast interrupt turnaround.



More information about the Comp.lang.c mailing list