Re: JavaMemoryModel: final, pseudo-final and write protectedfields

From: Bill Pugh (pugh@cs.umd.edu)
Date: Thu Oct 21 1999 - 16:56:09 EDT


>Or, more practical: change these fields from 'final' to 'volatile' (and then
>fix 'volatile').
>

I presume you mean "final volatile". Just volatile wouldn't prevent
arbitrary code from changing them.

Using "final volatile" as writeProtected would eliminate the need to
introduce a new key word into the language. Would still be ugly...

If did decide to introduce writeProtected into the language, you
could make it more useful by saying that the write protection only
applied to access from another package, and that any code within the
same package should be able to modify it.

        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:19 EDT