RFR: 8287788: Implement a better allocator for downcalls [v8]

Maurizio Cimadamore mcimadamore at openjdk.org
Thu Jan 23 14:37:56 UTC 2025


On Thu, 23 Jan 2025 14:32:22 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:

>> Exactly. initialValue happens on-demand, not upfront, i.e. in the very moment the VT calls get().
>> Whereas terminate happens as the last action of the CT.
>
> If this is really the case, I agree that there doesn't seem to be an alternative to use `ofAuto`. In which case you don't really need a TerminatingThreadLocal -- a CarrierThreadLocal is just fine (given we don't really have anything to do on close).

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.

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

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


More information about the core-libs-dev mailing list