RE: JavaMemoryModel: Performing speculative writes ahead of

From: David Holmes (
Date: Mon May 31 2004 - 00:26:42 EDT

Sylvia Else wrote:
> Essentially the compiler will not reorder the actions of an SC program if
> the consequence is observable.

As long as we all have the same notion of "observable".

> Neither the language nor the JMM say anything about how long things take.
> I'd argue that in that context, there can be no such thing as a "correct"
> benchmark that purports to measure the time taken by unobservable
> actions.

Taking that to the extreme a benchmark that produces only a time measurement
has no observable consequences other than that time measurement, and so
given the language and the JMM say nothing about how long things take, a
"correct" transformation of that benchmark would be a program that simply
gives the result of subtracting two consecutive time measurements, throwing
away the entire workload of the benchmark itself.

The problem with timing measurements is that the "unobservable" workload
does have an observable affect - it's just not a direct affect on a memory

> In any case, I don't think you'd get much sympathy for a model that slows
> things down in order for it to be possible to see how slow they were ;)

Much like GUI progress bars :-)

David Holmes

JavaMemoryModel mailing list -

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