RE: JavaMemoryModel: Waits, Interrupts and Notify-s

From: David Holmes (dholmes@dltech.com.au)
Date: Sat May 24 2003 - 01:06:57 EDT


> This is a change to the specification of wait(). Just
> because it won't break programs that follow what people feels is the
> 'proper' programming model doesn't mean that it won't break programs
> that are currently correct.

The implementation of wait() already allowed this - hence any broken
programs would have been exposed if they existed. The docs for wait()
should have mentioned spurious wakeups from day one. It's one of the
many sad Java stories as to why they did not and why it has taken this
long to try and rectify the matter.

> It also makes the distinction between notify() and
> notifyAll() at best at matter of statistics.

The spec allows that, but in practice VMs do not try and do the wrong
thing by you, they just need the elbow room to do the "wrong" thing in
some corner cases.

Honestly this is a paper changing exercise, not a change to any
existing function/behaviour.

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