Coupling in ExtentLocal

Ron Pressler ron.pressler at oracle.com
Fri Jul 29 20:37:23 UTC 2022


Hi.

The difference between ExtentLocals and other TwR constructs is that we’d like to use it for critical, foundational, things where we want guarantees we can rely on, and we haven’t been able to find a way to guarantee them as well as we’d like with TwR, even dynamically.

Yes, we are thinking about a "strong” TwR, but we’re busy with so many things so it might take a while. Until then, we might introduce a weaker, or less trustworthy version of ExtentLocals that uses the existing TwR and wouldn’t be used for critical things, but we think that it’s best to start incubation with just the lambda API and then see what problems are most common/annoying and how we can best address them.

— Ron

On 29 Jul 2022, at 15:35, Holo The Sage Wolf <holo3146 at gmail.com<mailto:holo3146 at gmail.com>> wrote:

Hi,

Thanks for the response Kasper, the reason I sent the mail to core-libs is because JDK-8263012<https://bugs.openjdk.org/browse/JDK-8263012> is assigned to "core-libs". I added loom-devs to the chain.


What Andrew Haley wrote is correct, it is also correct pretty much for every implementation of `AutoClosable` (although, unlike ExtentLocals, most implementations of AutoClosable will cause resource leak, and ExtentLocal can cause a big logical bug). The idea of `strong try-with-resources` seems to solve the problem (and can force better APIs in other places), is there a conversation about this feature?

Yuval Paz

On Fri, Jul 29, 2022 at 12:15 PM Kasper Nielsen <kasperni at gmail.com<mailto:kasperni at gmail.com>> wrote:

On Thu, 28 Jul 2022 at 22:11, Holo The Sage Wolf <holo3146 at gmail.com<mailto:holo3146 at gmail.com>> wrote:

I have a question about the proposal, why not allow try-with-resources with this API?

Hi,

For Loom related questions, loom-dev at openjdk.org<mailto:loom-dev at openjdk.org> is probably a better fit.

The main problem with TWR is that it cannot guard against non-nested use.
Because there are no way to force the user to call close(). See more here [1]

/Kasper

[1] https://mail.openjdk.org/pipermail/loom-dev/2021-June/002558.html


--
Holo The Wise Wolf Of Yoitsu

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/loom-dev/attachments/20220729/f8c7bfc7/attachment.htm>


More information about the loom-dev mailing list