RE: JavaMemoryModel: Minor issue on hb edges and interrupts

From: David Holmes (dholmes@dltech.com.au)
Date: Wed Mar 17 2004 - 17:33:39 EST


Bill Pugh wrote:
> There is a minor point that had been discussed before, but seems to have
> gotten left out of the public review draft.
>
> I am planning to add it back in:
>
> If thread T1 interrupts thread T2,
> there is a happens-before edge
> from the interrupted by T1
> to the point where any other thread (including T2)
> determines that T2 has been
> interrupted
> (by having an InterruptedException thrown
> or by invoking Thread.interruped or Thread.isInterrupted).

I'm not sure I agree that this is necessary - or necessarily a good thing.
The interrupt tells the thread to wakeup. Once the thread wakes up any
access to data shared between the interruptor and interruptee should be
correctly synchronized as normal.

What you are proposing essentially amounts to making the "interrupted"
"field" of a thread behave as a volatile - right?

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:00 EDT