volatile (in comp.lang.c)

00704a-Liber nevin1 at ihlpf.ATT.COM
Thu Jun 2 11:17:15 AEST 1988


In article <1078 at micomvax.UUCP> ray at micomvax.UUCP (Ray Dunn) writes:
|In article <1988May23.003847.1114 at utzoo.uucp> (Henry Spencer) writes:

|>Unfortunately, this is not sufficient.  "Volatile" does not guarantee
|>that operations are atomic.  It is entirely possible for x and/or y to
|>contain trash because they caught the variable midway through the
|>assignment.

|Fortunately this is sufficient when the programmer understands what he is
|programming, and chooses data types etc which will ensure atomicity, if that
|is what he is trying to achieve.

C itself does not guarantee that access to any particular data type,
including char, is atomic.  My question is:  is there *any* use for 'volatile'
which does not require 'atomicity' at some level?  If not, then 'volatile'
doesn't really fix any of the problems we have without it.

-- 
 _ __			NEVIN J. LIBER	..!ihnp4!ihlpf!nevin1	(312) 510-6194
' )  )				You are in a little twisting maze of
 /  / _ , __o  ____		 email paths, all different.
/  (_</_\/ <__/ / <_	These are solely MY opinions, not AT&T's, blah blah blah



More information about the Comp.lang.c mailing list