[concurrency-interest] question the about the JMM

David Holmes dcholmes at optusnet.com.au
Thu Dec 6 21:44:52 EST 2007


Larry,

You are completely losing me here. 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"?

Cheers,
David Holmes

> -----Original Message-----
> From: concurrency-interest-bounces at cs.oswego.edu
> [mailto:concurrency-interest-bounces at cs.oswego.edu]On Behalf Of Larry
> Riedel
> Sent: Friday, 7 December 2007 11:28 AM
> To: concurrency-interest at cs.oswego.edu
> Subject: Re: [concurrency-interest] question the about the JMM
>
>
>
> > > If "x" is volatile though, I would expect the cache
> > > coherence protocol to make sure r3==1 if r2==1.
> >
> > The cache coherence protocol knows nothing about "volatile".
>
> Then I think "The cache coherence protocol" may not
> be a good choice for use as a cache coherence protocol
> in a model for the behavior of a Java program.
>
>
> > [...] My system (like most) uses a write-through cache [...]
>
> Then I think the cache in "My system" may not be
> a good choice for use as the cache in a model for
> the behavior of a Java program.
>
>
> > [...] "cache coherence" 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.
>
>
> Larry
>
> _______________________________________________
> Concurrency-interest mailing list
> Concurrency-interest at altair.cs.oswego.edu
> http://altair.cs.oswego.edu/mailman/listinfo/concurrency-interest
>



More information about the Concurrency-interest mailing list