<div dir="ltr">I wonder if this example is hiding some optimization problem.  Although it's clear that the TPE does not escape, I'm having a hard time seeing how the JIT was able to prove that it could shorten the lifetime of the TPE through the swath of code in TPE::execute with all of its atomic ops to boot.</div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Dec 15, 2015 at 7:58 AM, thurstonn <span dir="ltr"><<a href="mailto:thurston@nomagicsoftware.com" target="_blank">thurston@nomagicsoftware.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">David Holmes-6 wrote<br>
<span class="">> Here’s another nasty little reachability/finalize example:<br>
><br>
><br>
><br>
> <a href="https://bugs.openjdk.java.net/browse/JDK-8145304" rel="noreferrer" target="_blank">https://bugs.openjdk.java.net/browse/JDK-8145304</a><br>
><br>
><br>
><br>
> David<br>
<br>
</span>I think this is an actual bug, i.e. it's a violation of the spec.<br>
If you look at TPE's code and the test case, #reject is being executed<br>
*after* #finalize has done it's dirty, and #reject() references an instance<br>
variable (#handler) - surely that's not allowed; I mean accessing an<br>
instance variable counts toward reachability, surely<br>
<br>
<br>
<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://jsr166-concurrency.10961.n7.nabble.com/DirectByteBuffers-and-reachabilityFence-tp12935p13081.html" rel="noreferrer" target="_blank">http://jsr166-concurrency.10961.n7.nabble.com/DirectByteBuffers-and-reachabilityFence-tp12935p13081.html</a><br>
<span class="im HOEnZb">Sent from the JSR166 Concurrency mailing list archive at Nabble.com.<br>
<br>
</span><div class="HOEnZb"><div class="h5">_______________________________________________<br>
Concurrency-interest mailing list<br>
<a href="mailto:Concurrency-interest@cs.oswego.edu">Concurrency-interest@cs.oswego.edu</a><br>
<a href="http://cs.oswego.edu/mailman/listinfo/concurrency-interest" rel="noreferrer" target="_blank">http://cs.oswego.edu/mailman/listinfo/concurrency-interest</a><br>
</div></div></blockquote></div><br></div>