-
Notifications
You must be signed in to change notification settings - Fork 137
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Question] How to get previous node of bucket sentinel? #957
Comments
You probably want to take a look at |
Copied from #938. In the code above, For example, if this |
The intention of the It simple loads the head pointer which has type |
I thought In the |
BTW, at least on my implementation, this doesn't make the hash table buggy, since even if TL;DR: This problem won't cause the code to fail. |
The return type for 'self.buckets.get()' for the split ordered list is '&Atomic<Node<K,MaybeUninit>', which means the returned value is a reference to the next field of some node in 'self.list'. I'm really not sure why you keep on saying using it will cause corruption of the array, which can only happen if it's an internal (children) node of the growable array, which it isn't. |
This is my current understanding on A In my understanding, |
Ah ok I see your point. I agree on your points and think that the current |
In
SplitOrderedList::lookup_buckets()
, we should be able to skip "finding" if we have a reference to the sentinel inself.buckets
.AFAIK,
self.buckets
gives us&Atomic<Node>
, which are references to the growable array's internal pointer to the sentinel node. At first, I thought of using these to create theCursor
object to return, but this doesn't make sense, since these references are not thenext
pointers of list nodes. "The Art of Multiprocessor Programming" doesn't uses cursors when looking up buckets, so doesn't seem to be experiencing this problem.As long as we are returning a
Cursor
forlookup_buckets()
, it seems like we should have a way to find the previous node of the sentinel. How should that be done? Am I missing something?The text was updated successfully, but these errors were encountered: