[concurrency-interest] Is Reference.reachabilityFence() needed in Reference constructor?
vitalyd at gmail.com
Wed Oct 21 18:32:37 EDT 2015
This is also the case on the CLR, and it produces "interesting" scenarios
such as finalizer running concurrent to an instance method:
.NET, there's a GC.KeepAlive(obj) method to extend liveness manually for
cases where it's needed.
On Wed, Oct 21, 2015 at 6:04 PM, Aleksey Shipilev <
aleksey.shipilev at oracle.com> wrote:
> No, they aren't. That's a common misconception.
> "Optimizing transformations of a program can be designed that reduce the
> number of objects that are reachable to be less than those which would
> naively be considered reachable. For example, a Java compiler or code
> generator may choose to set a variable or parameter that will no longer
> be used to null to cause the storage for such an object to be
> potentially reclaimable sooner."
> On 10/21/2015 11:29 PM, thurstonn wrote:
> > But the referent arg is on the stack (since the constructor is)
> > Aren't all variables on the stack strongly reachable?
> > --
> > View this message in context:
> > Sent from the JSR166 Concurrency mailing list archive at Nabble.com.
> > _______________________________________________
> > Concurrency-interest mailing list
> > Concurrency-interest at cs.oswego.edu
> > http://cs.oswego.edu/mailman/listinfo/concurrency-interest
> Concurrency-interest mailing list
> Concurrency-interest at cs.oswego.edu
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Concurrency-interest