Re: JavaMemoryModel: Re: JMM problems with latch or copy-on-write?

From: Joseph Bowbeer (jozart@csi.com)
Date: Fri Mar 30 2001 - 12:32:20 EST


Jeremy Manson wrote:

>> Example, in sequence:
>>
>> thread 1: initialized = true
>> thread 1: synchronized(obj) { }
>> thread 2: synchronized(obj) { }
>> thread 2: assert(initialized == true)
>
> Eep! That won't work, because in our model (again, can't speak for CRF),
> useless synchronization can be optimized away. Plus, oh, your next point.

It's unclear what "useless" means in your paper. The semantics paper I
found online says that a synchronized(obj) could be eliminated if only one
thread was locking on the object. This isn't the case in the example above.

Or, by "useless" do you mean that empty lock regions can be eliminated?
According to the definition of your model, empty lock regions as above
aren't entirely "useless".

By the way, I encourage everyone on this list to familiarize themselves with
both models so we can all discuss them both.

--
Joe Bowbeer

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



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