RFR: 8263551: Provide shared lock-free FIFO queue implementation
Kim Barrett
kbarrett at openjdk.java.net
Sun Mar 14 02:42:10 UTC 2021
On Sun, 14 Mar 2021 00:55:33 GMT, Kim Barrett <kbarrett at openjdk.org> wrote:
>> src/hotspot/share/utilities/lockFreeQueue.hpp line 113:
>>
>>> 111: // Return the entry following value in the list used by the
>>> 112: // specialized LockFreeQueue class.
>>> 113: static T* get_next(const T& value) {
>>
>> I think this function should not be public; it's needed internal to the implementation of this class, but if a client needs access to the next list entry it should be getting it via a member on T, assuming T provides such. And if it doesn't, well, you probably aren't supposed to be doing that. I see that LockFreeStack has public next and set_next; by that argument they should be private too. (I think the only reason they can't currently be private is because of unit tests, which could be fixed.)
>
> As mentioned elsewhere, I think there should be an associated set_next.
Normal naming convention is `next` without `get_` prefix.
-------------
PR: https://git.openjdk.java.net/jdk/pull/2986
More information about the hotspot-dev
mailing list