RE: JavaMemoryModel: Thread.stop()

From: Boehm, Hans (hans.boehm@hp.com)
Date: Fri Apr 09 2004 - 12:59:55 EDT


If Thread.stop() were either not deprecated or useful in correct code,
I would agree.

As it stands, I agree with Doug. We shouldn't mention Thread.stop(). I would
be surprised if it were correctly implemented in most VMs anyway (or would be,
if we knew what that meant). And a correct implementation would disallow many
of the optimizations we're trying hard to allow, since the exception would have
to be precise.

Hans

> -----Original Message-----
> From: owner-javamemorymodel@cs.umd.edu
> [mailto:owner-javamemorymodel@cs.umd.edu]On Behalf Of Bill Pugh
> Sent: Friday, April 09, 2004 6:22 AM
> To: Doron Rajwan
> Cc: javamemorymodel@cs.umd.edu
> Subject: Re: JavaMemoryModel: Thread.stop()
>
>
> I agree with Doron on this.
>
> The thread receiving the the ThreadDeath should be guaranteed
> to be synchronized with the creation of the ThreadDeath object.
>
> And in general, our story is that anyway of reliably communicating
> between threads creates a happens-before edge.
>
> Even if it is a way of synchronizing that we discourage.
>
> suspend/resume wouldn't count, because there isn't
> any point in the suspended thread that is a clear marker
> of the point at which the thread has received the suspension.
>
> Bill
>
>
> On Apr 8, 2004, at 2:40 PM, Doron Rajwan wrote:
>
> >
> > Although deprecated for a long time, java.lang.Thread
> > still have a public stop() method. This method causes
> > ThreadDeath Error to be thrown at the destination
> > thread, asynchronously. Moreover, it has an overload
> > that accepts a specific instance to throw, which can
> > be a class extending this ThreadDeath, and add
> > additional fields, objects, arrays, and so.
> >
> > 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.
> >
> > Thanks,
> > Doron.
> >
> >
> > =====
> > Doron Rajwan, mailto:doron@rajwan.org
> >
> > -------------------------------
> > JavaMemoryModel mailing list -
> > http://www.cs.umd.edu/~pugh/java/memoryModel
>
> -------------------------------
> JavaMemoryModel mailing list -
http://www.cs.umd.edu/~pugh/java/memoryModel
-------------------------------
JavaMemoryModel mailing list - http://www.cs.umd.edu/~pugh/java/memoryModel



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