At 12:42 PM 27/11/2003, Doug Lea wrote:
>2. There are no guarantees about synchronous effects of
> Thread.interrupt (and possibly, as Sylvia mentioned yesterday,
> Object.notify), so on the face of it the effects of the above
> statements could be reordered. Can you see any point in explicitly
> prohibiting this?
Seems to me that the notion of prioritization makes no sense in the absence
of a defined order for notify() and interrupt() invocations. So to say
we're disallowing prioritization of interrupt amounts to saying that we're
defining an order for notify/interrupt invocations. I rather assumed that
the order we were heading for was program order.
Changing the order for non trivial cases brings us right back to the
situation where the possible outcomes are hard to determine, or even
specify. Reordering, even in the trivial case, obviously violates program
order. In any case, it's only trivial if the program can see that the same
thread is both notified and interrupted. This is only true if the program
knows apriori that there is only one thread in the wait set. If the
programmer codes this sequence of operations in this situation, it's fair
to assume that they have a particular outcome in mind.
JavaMemoryModel mailing list - http://www.cs.umd.edu/~pugh/java/memoryModel
This archive was generated by hypermail 2b29 : Thu Oct 13 2005 - 07:00:55 EDT