On 15/09/2015 23:09, Caldarale, Charles R wrote:
>> From: Mark Thomas [mailto:ma...@apache.org] 
>> Subject: Re: RV-Predict bugs
> 
>> To make sure I understand this it is the possibility of the write T2W2
>> that is sufficient to ensure T2R1 and T2R4 are not re-ordered not the
>> possibility of a write in some other thread?
> 
> Section 14.2 requires that statements appear to execute in order, so the 
> second read cannot be issued by the JVM until after the write could occur.  
> The Java compilers (javac, C1, and C2) are not aware of whether or not 
> multiple threads are in play unless volatile, synchronized, or atomic 
> operations are explicitly done.  So in this case, the reordering is 
> prohibited by the statement execution order requirement, not the memory model.

OK. I think my understanding is getting there slowly.

I take it that once T2R1 has read the new value that there is no way
that T2R4 is going to read an older value e.g. by reading the value from
a different, older/out-of-date memory location.

My expectation is that once T2 has seen the updated value (originated
from another thread) all subsequent reads in T2 of the same field are
going to see the same value rather than some of those reads seeing an
older value (assuming there are no further changes in other threads).

Mark

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to