RFR: 8263551: Provide shared lock-free FIFO queue implementation [v2]

Man Cao manc at openjdk.java.net
Tue Mar 30 07:52:41 UTC 2021


On Fri, 26 Mar 2021 10:43:08 GMT, Ivan Walulya <iwalulya at openjdk.org> wrote:

>> Man Cao has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Address comment and add a gtest.
>
> src/hotspot/share/utilities/lockFreeQueue.hpp line 33:
> 
>> 31: 
>> 32: // The LockFreeQueue template provides a lock-free FIFO. Its structure
>> 33: // and usage is similar to LockFreeStack. It has inner paddings, and
> 
> probably need to add the conditional critical sections to the LockFreeStack for this description to be correct. But that can be done in a separate PR.

Superceded by not adding the ConditionalCriticalSection.

> src/hotspot/share/utilities/lockFreeQueue.inline.hpp line 33:
> 
>> 31: #include "utilities/lockFreeQueue.hpp"
>> 32: #include "logging/log.hpp"
>> 33: 
> 
> Don't we need inline specifiers for the functions below?

Added.

> src/hotspot/share/utilities/lockFreeQueue.inline.hpp line 108:
> 
>> 106:     // returns released objects to a free list for reuse, it could cause
>> 107:     // excessive allocations.
>> 108:     GlobalCounter::ConditionalCriticalSection<use_rcu> cs(use_rcu ?
> 
> ` GlobalCounter::ConditionalCriticalSection<use_rcu> cs(Thread::current());` should be fine, not sure how much is gained by skipping the `Thread::current()` call.

Superceded by not adding the ConditionalCriticalSection.

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

PR: https://git.openjdk.java.net/jdk/pull/2986



More information about the hotspot-gc-dev mailing list