>
>OK. I think I get it. When, say, a local is bound to a volatile ref,
>the contents accessed via the local need to be at least as fresh as
>that read of the volatile. Yes? So...
>
>Given field:
> volatile Node p;
>
>And code inside some method:
>
> Node tmp = p; // (*)
> // ... possibly lots of unrelated code ...
> int i = tmp.x; // the value x is at least as fresh as it was at (*)
>
>Right? In other words, assignments both to and from a volatile
>reference (or array) field normally entail some sort of memory
>synch operations.
>
>-Doug
Correct. What would really happen is that at the time p is read, the
processor would issue the instructions needed to update part or all
of the cache. A slightly more tricky issue is which values cached in
registers need to be reloaded, and which instructions can be
reordered with the load of p. Because of the more detailed control
the compiler has, many subtle variations on the semantics are
possible.
Bill
-------------------------------
JavaMemoryModel mailing list - http://www.cs.umd.edu/~pugh/java/memoryModel
This archive was generated by hypermail 2b29 : Thu Oct 13 2005 - 07:00:25 EDT