Re: JavaMemoryModel: deleting dead volatile ref's

From: Cliff Click (cliff.click@sun.com)
Date: Sun Jul 14 2002 - 22:56:25 EDT


Hey, no problem! It stays - for now. ;-)

Sometime Real Soon Now (but alas, probably not by the 1.4.2 release)
I intend to attempt to remove unneeded synchronization, nested locks
& the like. It's gonna be a bumpy ride! :-)

Cliff

David Holmes wrote:
> Cliff Click wrote:
>>If I see a dead volatile load I can remove the actual load, but
>>a volatile ref includes a 'MemBarAcquire' (in HotSpot parlance)
>>to help prevent various compiler & hardware reorderings. Can I
>>remove the MemBarAcquire as well?
>
> If I understand you right - NO! :) The use of a 'dummy' access to a
> volatile is often used purely for the memory affects. I have a
> hashtable-like data structure that allows concurrent read access without
> locks. A 'dead' read of a volatile is used to ensure fresh loads of the data
> variables.

-- 
Dr. Cliff Click      Chief Architect, HotSpot Server  Sun Microsystems, Inc.
Cliff.Click@Sun.COM  Senior Staff Engineer            4150 Network Circle
(408) 276-7046       MS USCA14-102                    Santa Clara, CA 95054

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



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