Posix 1003.4 vs. volatile.

Moderator, John S. Quarterman std-unix at longway.TIC.COM
Fri Apr 13 04:31:28 AEST 1990


From: Doug Gwyn <uunet!smoke.brl.mil!gwyn>

In article <622 at longway.TIC.COM> Ronald Guilmette <uunet!ics.UCI.EDU!rfg> writes:
>>The Posix committee apparently does not feel that it is reasonable to
>>require the programmer to write "volatile" on nearly everything to
>>insure correctness.
>I don't yet know what the committe as a whole feels, but I can assure
>everyone that attaching "volatile" to *everything* is not necessary.

Indeed, only shared variables need to be protected, and only within
critical regions.  This can be enforced locally, without forcing the
variables to be declared as volatile-qualified, through use of
volatile-qualified type casts or block-scope temporary variables.
This technique puts a considerable burden on the programmer, but hey,
he's the one who needs to specify precisely what may be and must not
be cached anyway..

Volume-Number: Volume 19, Number 59



More information about the Comp.std.unix mailing list