-
Notifications
You must be signed in to change notification settings - Fork 141
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] Is it safe to traverse Harris-*'s lists? #574
Comments
Here is my understanding, hope it helps. :)
Let's say you write a CDS, you try all different kinds of way to break this CDS, and this CDS is really well designed that it doesn't have any memory issue. Can I say this CDS is "safe"? If yes, then the word "safe" is related to the way how you manage your memory to make sure CDS don't have memory issues, like hazard pointers or epoch based memory reclamation, etc. If we are considering the word "safe" as: It is guaranteed that the Harris-'s lists write operation order = the order of successful CAS on the head and node's next pointer. Well, yes, we are still considering Harris-'s lists is "safe" in a way that it guarantee gives us some properties. However the remaining question is Harris-*'s lists read operation order, which leads to our second question.
Let's say you have 3 concurrent operations going in your list. Remove Node A, Read Node A, Change Node A's value, can we still get some solid equations like above? No, We don't know where this Read Node A operation should be placed. We can't decide the result should be null or new value or original value, all results make sense. Besides above, from the computer architecture perspective, each core has their own cache, and the value of it might be out of sync with the value in memory, it depends on the protocol of how cores are communicating with each other, like MESI. |
Thanks @poppindouble for great explanation. I'd like to add some more stuff. The problem is that the methodology for mathematically specifying libraries under relaxed memory model is not mature enough. Let me give a simple example. What we want is to have an efficient implementation of stack, and at the same time reason about the stack's behavior. So we should come up with a specification that explains such a weak behavior. For example, we can specify that if |
Thank you both for a very clear explanation! I understand the limitations of the current model. I have a followup question about @tomtomjhj 's comment:
I'm confused by what you mean by a relaxed memory model. In the cs431 implementation of Treiber's stack, we use acquire/release synchronization, so I feel like this problem cannot happen. Are you saying that |
@jessyoon14 I gave out my own understand in #582, hope it helps. :) |
@jessyoon14 |
Using acquire/release access on the atomic location doesn't guarantee that
Note that a successful |
Thanks for help me clear some of my misunderstandings |
Thank you! |
I have a question about slide 99 (Linearizability video 26:58).
In the video, professor mentions the following content:
During the traversal of Harris-*'s lists, the read operation may read stale values that is already overwritten in the shared memory, as it may read from its own cache. It may read a stale value that points to the already detached node. These complications are not yet resolved yet in literature.
I have two questions about this.
I would appreciate any help in understanding this topic.
Thank you in advance to anyone who answers :)
The text was updated successfully, but these errors were encountered: