On Thu, 23 Jan 2025 14:54:55 GMT, Maurizio Cimadamore <mcimadam...@openjdk.org> 
wrote:

>> alternatively - we could have some kind of internal "forceClose" API which 
>> doesn't check the owner thread. ~Some care is probably needed as the access 
>> is now on a different thread, so we'll need to make sure that some volatile 
>> accesses are used by this method, otherwise it might "miss" cleanup 
>> actions.~ (no need for volatile as the "carrier" thread is still the same)
>
> A simpler (maybe interim) solution: if the requesting thread is not virtual, 
> use the cache (and use a confined arena). Otherwise use a brand new confined 
> arena.

Yet another option would be to use a confined or shared arena depending on the 
requesting thread. Which means the terminating thread local would _sometimes_ 
close the arena, sometimes it will leave it to the GC.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/23142#discussion_r1927150864

Reply via email to