[concurrency-interest] Volatile array and Wait

Jeremy Manson jmanson at cs.purdue.edu
Wed Oct 19 12:53:01 EDT 2005


Chris Purcell wrote:
>> In this case, the write "b = b" is the release, and so must occur 
>> after the write "b[22] = x", which is the write we wish to publish.
> 
> 
> Actually, b[22] = x is supposed to have release semantics, so every 
> preceding write must be made visible before it commits.
> 
> Chris


This is exactly my point.  b[22] = x *doesn't* have release semantics. 
It looks like this:

int [] a = b; // volatile read
a[22] = x; // array write

There is no release in there.  That's why you need the write "b = b", 
which looks like this:

int [] a = b; // volatile read
b = a;  // volatile write

It is the volatile write that matters.

Like I said, it is hard to analyze this stuff.

					Jeremy


More information about the Concurrency-interest mailing list