Coupling in ExtentLocal

Holo The Sage Wolf holo3146 at gmail.com
Fri Jul 29 14:35:30 UTC 2022


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> wrote:

>
> On Thu, 28 Jul 2022 at 22:11, Holo The Sage Wolf <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 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/b1ab533a/attachment.htm>


More information about the loom-dev mailing list