On 1/17/2012 8:17 AM, Peter Duniho wrote:
On Tue, 17 Jan 2012 04:04:52 -0800 (PST), raphfrk@gmail.com wrote:
The spec says that all writes to volatiles can be considered to happen
before all subsequent reads. What does "subsequent" mean, is that
with regards to real time?
Essentially, yes. I believe the exact language talks about
synchronization
order" or something, but the basic idea is the order in which program
statements are effectively executed.
...
Even before analyzing the entire thread so far, I'm going to disagree
with this comment, because it can lead to an incorrect intuition.
Real time order is a total order, or can be made into one by adding a
tie breaker using the processor number for events that happen on the
same cycle in different processors.
The potential incorrect intuition is that there is a total order of all
events in a Java program. There isn't.
There are a number of important partial orders: synchronization order,
happens-before, and program order within a thread. The behavior of reads
and writes must be consistent with the relevant partial orders, but do
not have to be consistent with any one total order.
The problem with imposing a total order is the amount of inter-processor
communication and coordination it would require.
Patricia
I was) which in reality may not be the case.