Hans Boehm wrote:
> Perhaps another way to think of it is that the "isInterrupted" flag is
> used to communicate between threads. As such, we'd tell a programmer that
> it should be made volatile. Thus it would be counterintuitive if the
> library didn't follow the same rules.
Sure I can see that. But I'm more concerned about the obscurity it
introduces. But then, in terms of spotting unsynchronized accesses, I guess
this is no different to the isAlive()/join() case. Though I should point out
that I disagree with the visibility semantics applying to isAlive() for the
same reason - there's an implied monitor use with termination and join()
hence no need to include a hidden volatile.
While these methods represent "communication" I don't consider them to
exchange data. But obviously they can be viewed that way.
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:01:00 EDT