Re: JavaMemoryModel: Proposals on wait and interrupts

From: Sylvia Else (sylviae@optushome.com.au)
Date: Tue May 27 2003 - 08:15:09 EDT


At 11:03 AM 26/05/2003 -0400, Bill Pugh wrote:

>Sylvia didn't like the renotification rule, because it doesn't have the
>same semantics as non-deterministically making sure that notified threads
>and interrupted threads are disjoint. I don't think this is a realistic
>expectation, and in particular, I don't the example he gave is one that we
>should guarantee should work. The renotification rule isn't trivial, but
>it ensures that many design patterns for using notify() work, without
>requiring explicit calls by the programmer to notify in all of the catch
>blocks for IE.

I have no particular attachment to my example (BTW, I'm female), which was
obviously contrived to cause trouble. However, if we are going to have a
class of algorithms that are unsupported, then programmers need a
straightforward way of knowing whether or not they are implementing an
algorithm belonging to the class.

To my mind, the only way of being sure of getting that right is for
interrupt() to be documented as possibly causing the target thread to issue
a notify on the monitor on which it is waiting, if any, after it reacquires
the lock on that monitor.

To the casual reader, that is going to look very strange, and certainly
counter intuitive.

Sylvia.

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



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