[concurrency-interest] Thread safety of WeakReference .get() method?
vitalyd at gmail.com
Fri Aug 10 09:30:38 EDT 2012
Yup I saw it on that list as well - quick work by Vladimir! :)
Sent from my phone
On Aug 10, 2012 2:05 AM, "Aleksey Shipilev" <aleksey.shipilev at oracle.com>
> 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).
> This is the submitted bug (not available in public yet):
> And this is the fix:
> 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.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Concurrency-interest