[concurrency-interest] question the about the JMM

Larry Riedel larryr at saturn.sdsu.edu
Thu Dec 6 23:12:06 EST 2007


> > > The problem with using "cache coherence" as a logical model
> > > for the JMM is two-fold. First, it is insufficient as it
> > > doesn't address reorderings that the runtime compiler is
> > > allowed to do. [...]
> >
> > Is there a canonical or ubiquitous example of this?  I am
> > interested in the difficulties with using a model which
> > includes, for example, a simple object cache coherence
> > protocol based on a distributed directory.
> 
> All I can say to address your last question is:
> 
> Given:
>    bool flag = false;  // a field
>    while (!flag) {
>       work();
>    }
> The compiler can, in the absence of volatile, rewrite this as:
>    if (!flag) {
>       while (true) {
>          work();
>       }
>    }
> Now what has any of that got to do with a "cache
> coherence protocol"?

I presumed a "logical model for the JMM" would be addressing
propagation of object state changes between threads.  The
thread above does not seem to be interested in making sure
it has the latest state information for any objects...


Larry



More information about the Concurrency-interest mailing list