JavaMemoryModel: Proposed wording on lost interrupts

From: Bill Pugh (pugh@cs.umd.edu)
Date: Wed Aug 06 2003 - 15:14:29 EDT


The JSR133 expert group is still trying to decide whether to use a
strong or weak version of the semantics associated with wait(),
notify() and Interrupted Exceptions.

In particular, consider the situation where threads T1 and T2 have
both performed a wait on an object X and are in the waitset for X.
Then the following two actions are performed, in either order:
* T1 is interrupted
* X.notify() is invoked

Which of the following behaviors is allowed?

a) T1 returns from the call to wait() by throwing interrupted exception,
    T2 returns normally from the call to wait()

b) T1 returns normally from the call to wait() and still has a pending
    interrupt; T2 remains in the waitset for X

c) T1 returns from the call to wait() by throwing interrupted exception;
    T2 remains in the waitset for X

Behavior (a) is the preferred behavior, and the strong version of the
wait/interrupt semantics allows only behavior (a). Weaker versions of
the wait/interrupt semantics would allow either behaviors (a) and
(b), or even any of the three.
-------------------------------
JavaMemoryModel mailing list - http://www.cs.umd.edu/~pugh/java/memoryModel



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