Re: JavaMemoryModel: Issue with final fields

From: Cliff Click (Cliff.Click@sun.com)
Date: Sat Feb 02 2002 - 23:18:48 EST


Bill Pugh wrote:

> At 9:54 AM -0800 2/1/02, Cliff Click wrote:
>> Yes it bothers me, but not a lot. You published a bogus Foo. Anything
>> that touches this bogus Foo is now Bogified (TM). You and your program
>> will be shot at dawn. :-)
>> Cliff
>
> No, you've got it reversed. Under the current version of our semantics,
> the compiler would not be able to perform that optimization. If a thread
> loads both a proper reference to a Foo and a Bogified reference to that
> same Foo, the Bogified reference does _not_ taint the proper reference
> to the Foo.

Well, why the heck not? You publish a Bogon, you die. You call a library
routine, which publishes a Bogon and the compiler inlines and exposes ...
you die. Lesson: don't publish Bogons or call upon suspect libraries which
publish Bogons or ... you occasionally eat a NULL you didn't expect.

Please don't punish Java performance in the name of saving us from Bogons.
You're asking me to turn off CSE.

Cliff

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



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