RFR: 8315559: Delay TempSymbol cleanup to avoid symbol table churn [v4]

Oli Gillespie ogillespie at openjdk.org
Wed Nov 8 10:57:05 UTC 2023


On Tue, 7 Nov 2023 20:00:17 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:

>> Thanks for all the details, I hadn't considered the SMR angle. I'll think about alternatives.
>
> In a brief conversation with Kim, where I bemoaned that there should be a simpler solution, he suggested maybe a fixed ring buffer with a xchg to replace the n'th element, like:
> 
> 
> const uint N = ...;
> Symbol* volatile _delay_queue[N]; // initialize to nullptr
> volatile uint _index = 0;
> 
> void add(Symbol* s) {
>   ... increment refcount for s 
>   uint i = Atomic::add(&_index, 1u) % N;
>   Symbol* old = Atomic::xchg(&_delay_queue[i], s);
>   if (old != nullptr) {
>     ... decrement refcount for old, possibly deleting it
>   }
> }

🥳 no more NonblockingQueue! I think this is great, thanks, I will try it out today.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/16398#discussion_r1386435934


More information about the hotspot-dev mailing list