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 <holo3...@gmail.com<mailto:holo3...@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 <kaspe...@gmail.com<mailto:kaspe...@gmail.com>> wrote: On Thu, 28 Jul 2022 at 22:11, Holo The Sage Wolf <holo3...@gmail.com<mailto:holo3...@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-...@openjdk.org<mailto:loom-...@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