Re: JavaMemoryModel: Reconsidering prioritized InterruptedExceptions

From: Martin Trotter (
Date: Thu Nov 27 2003 - 05:31:16 EST

>>The Object.wait spec can just add three words:
>> If the current thread is interrupted by another thread while it is
>> waiting FOR A NOTIFICATION...

Surely this makes concrete implementation tricky ? If I take a plausible
case of mapping a monitor onto a mutex and condvar pair then in pthread
terms I have a single operation ; pthread_cond_wait which enters the wait
set, unlocks the mutex, is notified or interrupted, leaves the wait set,
reacquires the mutex and returns. With the above spec I have to make sure
that the OS delivers precisely the desired semantics and doesn't for
example attempt to interrupt the wait for re-acquisition of the mutex. If
the OS doesn't do the 'right' thing or, much more commonly, doesn't even
specify its behaviour at this level of detail, I'm prevented from the above
implementation choice and am forced into building my own layer on top of
the OS. I don't think we should go that way for the reasons already

Martin Trotter

JavaMemoryModel mailing list -

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