volatile, shared memory, and synchronisation

Robert Firth firth at sei.cmu.edu
Wed May 25 08:27:06 AEST 1988


In article <11629 at mimsy.UUCP> chris at mimsy.UUCP (Chris Torek) writes:

[ volatile variables are still vulnerable to the "interrupted update"
  error]

>Volatility is only part of what you need for synchronisation.

It might be worth pointing out that the Ada programming language
provides the pragma "Shared" to indicate shared variables.  The
language reference manual says [RM 9.11 (11)]

	An implementation must restrict the objects for which the
	pragma SHARED is allowed to objects for which each of
	direct reading and direct updating is implemented as an
	indivisible operation.

I believe this captures the required semantics.  (Of course, the
RM also explains you can't slave local copies &c either)



More information about the Comp.lang.c mailing list