Re: JavaMemoryModel: New Unified JMM Description

From: Jeremy Manson (jmanson@cs.umd.edu)
Date: Tue Apr 13 2004 - 15:14:08 EDT


Boehm, Hans wrote:
> I think I may have been (or maybe still am) confused on a similar point, so maybe this helps.
>
> The problem with section 7.6 seems to be that it's not immediately apparent that you can justify
> a sequentially consistent execution.
>
> If we have
>
> Thread 1
> x = 1;
> r1 = x;
>
> Thread 2
> x = 2;
> r2 = x;
>
> Let's say I want to justify r1 = r2 = 2.
>
> Clearly I can put x = 1 and x = 2 in C1.
>
> I can clearly add r2 = x with W2(r2=x) = (x=2) in C2, since
> the write x = 2 happens-before the read into r2.
>
> But I think I can only add r1 = x to C3 with W3(r1=x) = (x=1) .
> This is very counterintuitive, but OK, since I can still have
> W(r1=x) = (x=2).
>
> If I'm interpreting this correctly, there at least needs to be
> a footnote explaining the significance of the "i-1" in rule 5.
>

That's right. The point is that once you have justified the existence
of that read (which you can only do by considering the actions that have
been committed, plus the actions that happen-before the read), it can
see any value that it is happens-before consistent to see (roughly).

                                        Jeremy
-------------------------------
JavaMemoryModel mailing list - http://www.cs.umd.edu/~pugh/java/memoryModel



This archive was generated by hypermail 2b29 : Thu Oct 13 2005 - 07:01:03 EDT