Re: JVM optimization
- From: Lee Fesperman <firstsql@xxxxxxxxxxxxx>
- Date: Wed, 18 May 2005 20:00:00 GMT
John C. Bollinger wrote:
>
> I can't speak for Mark or Chris, but I insist that the behavior of a
> Java program must be among those consistent with the language
> specification, inasmuch as can be observed. How is one to write
> programs with predictable behavior if one cannot rely on the specs? You
> can argue that the specs are inconvenient or poorly conceived. Indeed,
> the JSR 133 working group did precisely that, and came up with what
> appears to be a significant improvement. If you are really supporting
> implementation of JVM / program behavior that is observably inconsistent
> with the spec, however, then we are indeed at an impasse, and this
> discussion cannot progress.
It seems that we are at the 'agree to disagree' stage. However, you added some parting
shots below, which I will respond to.
> Assuming that you are not arguing for outright VM non-compliance, you
> seem to be arguing for different semantics than Java has chosen, even in
> the new memory model. That's fine, but I don't think I can reason with
> you about the relative merits of your preferred semantics vs. Java's
> specified semantics (or about whether there is a difference at all)
> without considerably more detail on what your preferred semantics
> actually are. Unless you're prepared to pledge support for one of the
> existing models, that would amount to you more or less presenting a
> whole memory model of your own, at least in outline. I'm guessing that
> (the latter) won't happen.
No, I'm not arguing for a new memory model. The 'purpose' of the current (1.5) memory
model is to ensure proper utilization of shared variables within shared synchronization
blocks. Like most technical writing, it concerns itself with the mechanism rather than
describing its purpose, its reason for existing. In order to cover the general case, it
includes all shared variables (because of 'anonymous' locks). The fact that this
mechanism also affects shared variable access outside the synchronized sections is a an
unavoidable side effect. Depending on this side effect is very dicey coding and
is improper/obtuse code. It can only be guaranteed to avoid stale values in extreme
cases. Instead of referencing shared variables outside synchronized sections, a better
technique would be to store the current value in a local variable inside the
synchronized section for use outside the synchronization. Our system uses that exact
technique to improve concurrency.
I'm not arguing for a new memory model. To achieve the capability I'm referring to would
require the memory model spec add a section saying that a compiler could violate
covering all shared variables when it knew it was 'safe'. That would just clutter the
spec, just like the JLS section that says that *all* objects are allocated on the heap
doesn't bother saying, "Oh, if the compiler is smart enough, it can violate this
principle." It would have to add this in a lot of places, diluting the spec. The spec is
intended to enforce a minimum level of compliance, to ensure the expectations of correct
execution by even the most complex Java application are met.
No, I'm not arguing for outright VM non-compliance but for an "as if" reading of the
spec. In my view, you're being overly rigid in this aspect (there has been a goodly
amount of authoritarianism on this forum recently), since you can't describe a case
where expecting special behavior of shared variables outside synchronization sections
would be justified or useful.
--
Lee Fesperman, FFE Software, Inc. (http://www.firstsql.com)
==============================================================
* The Ultimate DBMS is here!
* FirstSQL/J Object/Relational DBMS (http://www.firstsql.com)
.
- References:
- JVM optimization
- From: ilkinulas
- Re: JVM optimization
- From: bugbear
- Re: JVM optimization
- From: Chris Uppal
- Re: JVM optimization
- From: Lee Fesperman
- Re: JVM optimization
- From: Chris Uppal
- Re: JVM optimization
- From: Lee Fesperman
- Re: JVM optimization
- From: Mark Thornton
- Re: JVM optimization
- From: Lee Fesperman
- Re: JVM optimization
- From: Mark Thornton
- Re: JVM optimization
- From: Lee Fesperman
- Re: JVM optimization
- From: Lee Fesperman
- Re: JVM optimization
- From: John C. Bollinger
- Re: JVM optimization
- From: Lee Fesperman
- Re: JVM optimization
- From: John C. Bollinger
- Re: JVM optimization
- From: Lee Fesperman
- Re: JVM optimization
- From: John C. Bollinger
- Re: JVM optimization
- From: Lee Fesperman
- Re: JVM optimization
- From: John C. Bollinger
- JVM optimization
- Prev by Date: Tiles
- Next by Date: help on how to save/load this data structure?
- Previous by thread: Re: JVM optimization
- Next by thread: Re: JVM optimization
- Index(es):
Relevant Pages
|