RE: JavaMemoryModel: Spec on on wait and interrupts

From: Doug Lea (dl@cs.oswego.edu)
Date: Wed Jul 30 2003 - 21:13:04 EDT


(Wow, too many issues on too many fronts...)

Here's the part I am still uncomfortable about. Suppose you have
underlying blocking/unblocking mechanics in which signals and
interrupts are never "lost". And you are implementing wait() using
them. Are you allowed to do

void wait() {
  // ... wait, wake up, etc
  // and then as your final act, if you haven't already abnormally exited,
  if (Thread.isInterrupted()) throw new InterruptedException();
}

I want the answer to be yes, even though it means that you
cannot, by virtue of getting IE know whether you were woken up
"because" of a signal or an interrupt. (This may in turn reflect the
fact that nothing else in the system, even though it is correct, knows
this either.)

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



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