[concurrency-interest] Thread safety of WeakReference .get() method?

Aleksey Shipilev aleksey.shipilev at oracle.com
Fri Aug 10 12:43:17 EDT 2012


The regression tests we have have much too similar form, so don't
bother. I'll try to double-check this test added to internal regression
tracking.

Thanks,
Aleksey.

On 08/10/2012 07:44 PM, Dr Heinz M. Kabutz wrote:
> Hi Aleksey,
> 
> if I convert my test into a JUnit testcase, could we possibly
> incorporate it into a suite of concurrency tests for regression tests?
> 
> Regards
> 
> Heinz
> -- 
> Dr Heinz M. Kabutz (PhD CompSci)
> Author of "The Java(tm) Specialists' Newsletter"
> Sun Java Champion
> IEEE Certified Software Development Professional
> http://www.javaspecialists.eu
> Tel: +30 69 75 595 262
> Skype: kabutz 
> 
> 
> 
> On 8/10/12 9:05 AM, Aleksey Shipilev wrote:
>> On 08/08/2012 06:11 PM, Aleksey Shipilev wrote:
>>   
>>> Hence, the compiler should probably handle the fields which are normally
>>> updated by the GC in a specific way, e.g. prevent hoisting. Marking
>>> referent as volatile brings that effect into life, but at the cost of
>>> volatile write for the initial value (we had some optimization in mind
>>> to handle that, but this is by no means a quick solution).
>>>     
>> FYI.
>>
>> This is the submitted bug (not available in public yet):
>>  http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7190310
>>
>> And this is the fix:
>>  http://mail.openjdk.java.net/pipermail/hotspot-compiler-dev/2012-August/008190.html
>>
>> I had double-checked Heinz's testcase now works, and disassembly shows
>> plain field read inside the loop. membar_acquire had essentially reduced
>> to nop on my x86 laptop.
>>
>> -Aleksey.
>> _______________________________________________
>> Concurrency-interest mailing list
>> Concurrency-interest at cs.oswego.edu
>> http://cs.oswego.edu/mailman/listinfo/concurrency-interest
>>
>>   



More information about the Concurrency-interest mailing list