RE: JavaMemoryModel: Thread.stop()

From: David Holmes (dholmes@dltech.com.au)
Date: Thu Apr 08 2004 - 19:19:41 EDT


> Doron Rajwan wrote:
> I think that when speaking on happens-before edge for
> interrupted threads, we should also consider stopped
> threads. At least in the stop(Throwable obj) overload,
> there must be a happens-before edge between the caller
> and the stopped thread.

Again I have to disagree. If the thread invoking stop() wants to communicate
to the thread being stopped via some shared data then that shared data
should be accessed under synchronization - pure and simple. I don't see any
need, from an application viewpoint, for there to be an explicit
synchronization relationship between the thread doing an interrupt() or
stop() (or resume() - also deprecated, also still present and also part of
the JDI API), and the target thread. It is quite likely that an
implementation will use some technique that introduces such an edge but it
should not be specified and should not be relied upon. If data is shared
then access it under synchronization of some form.

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:01:02 EDT