Re: JavaMemoryModel: A memory model for the masses

From: Bill Pugh (pugh@cs.umd.edu)
Date: Tue Nov 09 1999 - 12:26:36 EST


At 10:04 PM -0800 11/8/99, Joshua Bloch wrote:
>Bill,
>
> You make some reasonable points, but I'm not prepared to bite the bullet
>yet. On the other hand, I haven't had time to follow the discussion, so so I
>may be living in a fool's paradise. I still think it's of the utmost
>importance that it be possible to write immutable classes that don't
>synchronize every operation but do guarantee their behavior, even in the case
>of abuse. We should be able to guarantee the sanctity of String and the
>primitive wrapper types, and it shouldn't take a Ph.D. to write
>safe immutable
>types.

I think we still need to guarantee things for final fields, even
without synchronization. Amoung other points, we sort of need that in
order to allow optimization of final fields to ignore synchronization.

One point to make is that we aren't planning to actually break some
of these idioms outside the box (e.g., the single check idiom). I am
just suggesting that we say they are outside the box, no guarantees
will be made, and encourage people to get inside the box.

        Bill

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



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