Re: JavaMemoryModel: Thread model algorithm.

From: Sylvia Else (
Date: Wed Nov 19 2003 - 15:53:28 EST

At 09:14 AM 19/11/2003 -0500, Doug Lea wrote:
>* Whether an already-interrupted thread calling wait() will detectably
> release and re-acquire the lock. Because there are no ordering
> guarantees for acquisition, no one can reliably detect whether you
> release and immediately re-acquire. Which means that
> implementations can pre-check status and return immediately if so
> desired.

If the specification allows the release and re-acquisition of the lock,
this is certainly true. No test could demonstrate that the lock is not in
fact released.

On the other hand, if the specification prohibits the release and
re-acquisition, then a single detection of a release would serve as a
demonstration that the implementation is incorrect.

What I find unsatisfactory is that the specification seems to be entirely
silent on this issue, which creates the danger that people will, perhaps
unconsciously, form improper inferences based on other aspects of the

I have no view on whether release and re-acquisition should be permitted
(as distinct from mandated), but I think the specification should make it
clear, one way or the other.


JavaMemoryModel mailing list -

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