Re: JavaMemoryModel: Problem with Thread.sleep

From: Joseph Bowbeer (jozart@csi.com)
Date: Sat Oct 23 1999 - 15:15:40 EDT


Bill,

Concerning your memory model: I can understand it, which is definitely an
improvement.

Though there's still this tremendous leap from an object-oriented viewpoint
in the first part of the spec to a variable-oriented viewpoint in chapter
17. We should make it clear (spell it out) that synchronization w.r.t. a
reference field is unrelated to synchronization w.r.t. the fields of the
referenced object.

> Another possibility is to use interrupts.
>
> Basically, we could say that whenever thread T1 interrupts T2, that it is
> treated as a release by T1 on the interrupt, when is acquired by T2 when
it
> detects the interrupt (e.g., by throwing an InterruptedException).
>

thread.interrupt() isn't synchronized. Is this a problem?

--
Joe Bowbeer

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



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