Re: JavaMemoryModel: Do getfield/putfield correspond to use/assign or load/store?

From: Assaf Schuster (assaf@cs.technion.ac.il)
Date: Tue Mar 27 2001 - 12:07:48 EST


Indeed, this is an important question that was not addressed explicitly
in the original spec. Note, however that your question has a more broader
context:

 < How will all vendors in the world manufacture compliant >
 < JVMs when they have no spec for its memory model??? >

BTW, to the best of my knowledge, even the newly proposed memory
model by Pugh is missing explicit definition for the JVM level.

Back to the original spec in Ch 17.
As you noticed, translating use/assigns to putfields/getfield creates more
confusion. However, if you look closely in between the lines, you'll find
hints that the original intention was to map load/stores to
putfields/getfields.

Quote: "The purpose of the prescient stores relaxation is to allow
optimizing
Java compilers to perform certain kinds of code rearrangement that preserve
the semantics of properly synchronized programs..." Now, on the one hand,
we would like to apply PS rearrangements to putfields/getfields, and on the
other hand, JMM translates program source code one-to-one to use/assigns,
and requires that use/assigns be performed in program order.
So, one concludes that putfields/getfields correspond to stores/loads.

We took this assumption, and in our paper (note the new version appeared in
ACM TOCS, Nov. 2000 www.cs.technion.ac.il/~assaf/publications/java.ps)
we gave the ONLY EXISTING EXPLICIT MEMORY MODEL FOR JVM
LEVEL. (As a bonus, it is non-operational, and is much simpler (except for
the
proofs, of course) than the original).

In the paper you can find a proof that JVM memory model is coherent.

---- Assaf

----- Original Message -----
From: "Fang Wei Jian" <wjfang@csis.hku.hk>
To: <javaMemoryModel@cs.umd.edu>
Sent: Tuesday, March 27, 2001 8:03 AM
Subject: JavaMemoryModel: Do getfield/putfield correspond to use/assign or
load/store?

> Standing at the view point of JVM, which actions
> do getfield/putfield correspond to, use/assign or load/store?
>
> Java specification (Chapter 17) doesn't state that explicitly. In Alex
> Gontmakher and Assaf Schuster's paper "Java consistency: nonoperational
> characterizations for Java memory behavior", getfield/putfield were
> interpreted to load/store. In Puph's paper "Fixing the Java
> Memory Model", getfield/putfield were interpreted to use/assign.
> However, Puph also supports that Java requires coherence.
>
> These two interpretation seem contradictive to me. If getfield/putfield
> correspond to load/store, according to Java specification, read/write is
> required (in this context, coherence is easily to understand); if
> getfield/putfield correspond to use/assign, read/write is optional! The
> memory mode is rather weak.
>
> Another question also confused me: what is thread working memory? If
> getfield/putfield correspond to load/store, thread stack can be considered
> as thread working memory. if getfield/putfield correspond to use/assign,
> thread stack is a part of thread engine.
>
> Best Regards,
>
> Fang Wei Jian
>
>
> -------------------------------
> JavaMemoryModel mailing list -
http://www.cs.umd.edu/~pugh/java/memoryModel
>

-------------------------------
JavaMemoryModel mailing list - http://www.cs.umd.edu/~pugh/java/memoryModel



This archive was generated by hypermail 2b29 : Thu Oct 13 2005 - 07:00:30 EDT