RFR: 8280828: Improve invariants in NonblockingQueue::append [v2]

Ivan Walulya iwalulya at openjdk.java.net
Tue Feb 8 11:14:12 UTC 2022


On Tue, 8 Feb 2022 10:09:48 GMT, Kim Barrett <kbarrett at openjdk.org> wrote:

>> Please review this change to NonblockingQueue to improve invariants in the
>> append operation by making a change in try_pop.
>> 
>> When taking the last entry in the queue, try_pop needs to do some cleanup of
>> the queue fields, setting them to NULL.  The order of those cleanups doesn't
>> matter for correctness.  However, setting first _head then _tail permits
>> append to assert that _head is NULL when it finds _tail was NULL.  The current
>> order (set _tail first, then _head) doesn't permit such an assertion.
>> 
>> Testing:
>> mach5 tier1-3
>> 
>> I also did lots of testing with this change included while investigating
>> JDK-8273383.
>
> Kim Barrett has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains three additional commits since the last revision:
> 
>  - Merge branch 'master' into append-invariant
>  - minor comment fixes
>  - append invariant

Lgtm!

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

Marked as reviewed by iwalulya (Reviewer).

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


More information about the hotspot-dev mailing list