[concurrency-interest] DirectByteBuffers and reachabilityFence

Vitaly Davidovich vitalyd at gmail.com
Wed Dec 9 14:21:58 EST 2015


It may still be needed when you need to extend the lifetime of an object
you hold but that would otherwise be early reclaimable.  But that's a much
more minimal use case, which is why I said the advantage is that rF() would
be used in much fewer places.

On Wed, Dec 9, 2015 at 1:40 PM, Andrew Haley <aph at redhat.com> wrote:

> On 12/09/2015 05:53 PM, Gil Tene wrote:
>
> > My take on this would be to change the JLS and JVM spec to state
> > that 'this' remains reachable until after the last instruction of
> > every instance method. Period. This would basically equate to
> > placing an implicit reachability fence at all exist points of every
> > instance method (I.e. The equivalent of a try...finally). The "nice״
> > thing about such an implicit reachability fence is that it does not
> > really defeat any optimizations, as it only serves to extend the
> > lifetime of an oop (so potentially pressing slightly harder on the
> > register allocator). IMO this would auto-magically fix lots of
> > current rarely occurring bugs (like those on DBB, but also in user
> > code), and prevent many future ones.
>
> Mmmm.  That's what I said!  One other advantage to doing this
> automagically is that you won't get all these Java devs arguing about
> whether the reachabilityFence really was needed.
>
> Andrew.
> _______________________________________________
> 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/20151209/616a50b3/attachment-0001.html>


More information about the Concurrency-interest mailing list