[concurrency-interest] question the about the JMM
larryr at saturn.sdsu.edu
Fri Dec 7 12:59:26 EST 2007
> > > To me, cache coherence is a protocol used by a processor
> > > to address the consistency of its caches. It defines the
> > > behavior of reads and writes to the same memory locations.
> > That sounds like a pretty good description to me. I
> > think I might just change "a processor" to "a set of
> > threads", and "memory locations" to "sets of objects".
> Not really. A cache coherence protocol is for hardware, not
> a programming language.
A cache is a container of local unshared snapshots of the states
of non-local shared objects, and a cache coherence protocol is
a mechanism for supporting the externally visible object state
consistency model. Cache coherence protocols are fundamental
to contemporary network filesystems and relational databases,
and are no more exclusive to hardware than content-addressable
storage or myriad other abstract data types which happen to have
implementations in hardware. I agree though it seems better to
say the memory consistency model is defined and provided by the
runtime environment, not the Java language itself; I never meant
to imply the latter; I think of constructs like "volatile" and
"synchronized" as language-level mechanisms for interfacing with
the memory consistency mechanism of the runtime environment.
More information about the Concurrency-interest