On Mon, 15 Jul 2024 10:50:34 GMT, Jorn Vernee <jver...@openjdk.org> wrote:
> This is what I was thinking of as well. close() on a shared arena can be > called by any thread, so it would be possible to have an executor service > with 1-n threads that is dedicated to closing memory. This delays both the closing of the Arena and the freeing of the segments, so bugs may be not discovered if the arena is accessed in between the time the thread pool is notified and the time the close() is effectively called. And you loose the structured part of the API, you can not use a try-with-resources anymore. I think that part can be fixed using a wrapper on top of Arena.ofShared(). ------------- PR Comment: https://git.openjdk.org/jdk/pull/20158#issuecomment-2228280373