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

Vitaly Davidovich vitalyd at gmail.com
Wed Aug 8 09:00:39 EDT 2012


You will need to treat WeakReference as any other non-threadsafe class and
provide the necessary happens-before edges if you want to share the
instance amongst java threads.

Sent from my phone
On Aug 8, 2012 8:54 AM, "Raph Frank" <raphfrk at gmail.com> wrote:

> So, if I create a weak reference to an object when it is created, it
> is still safe to use (well no less safe anyway).
>
> Sounds like this issue occurs if the last reference to an object is
> released by one thread and the WeakReference.get() is checked from
> another?
> _______________________________________________
> Concurrency-interest mailing list
> Concurrency-interest at cs.oswego.edu
> http://cs.oswego.edu/mailman/listinfo/concurrency-interest
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://cs.oswego.edu/pipermail/concurrency-interest/attachments/20120808/f0dff4a2/attachment.html>


More information about the Concurrency-interest mailing list