RE: JavaMemoryModel: Problem with Thread.sleep

From: David Holmes (dholmes@ics.mq.edu.au)
Date: Sun Oct 24 1999 - 20:32:18 EDT


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

Despite this method not being synchronised and contrary to the incorrect
comments regarding why it is not synchronised, the interruption mechanism,
to work correctly will require synchronisation at some level (at least on
UNIX like systems).

The question is whether thread.interrupt() and the interruption mechanism
should have defined communicative properties with regard to the memory
model. If so, how can that be expressed - at present the only way is to
define the method to be synchronised, which is too limiting in terms of the
implementation.

We shouldn't need to know the implementation of methods to know their
affects on the memory model. Nor should the implementation be artificially
constrained to use monitors to effect memory barriers.

Cheers,
David Holmes

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



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