-
Notifications
You must be signed in to change notification settings - Fork 7
abortion/retry conditions for concurrent linked list #72
Comments
|
@HaritzPuerto Thank you for pointing out my mistake. Yes, a node is regarded as deleted when the first RMW that marks the node succeeds. |
You mean checking if first RMW and CAS for deletion/insertion is enough?? When given X->Y->Z and trying to delete Y and inserting new node between Y and Z, if Y's next is marked, for insertion, next = Y.next is Z with marked 1. For deletion, think about the situation that tries to remove Y and inserting new node next X. Even if deletion successfully marks Y's next as deleted, a node can be inserted between X and Y successfully and X's next can be changed before deletion completes. Then, second CAS of deletion, trying to set X.next = Y to X.next = Z fails, since X.next is changed to new node. I think their success are not simply checked with only first RMW and CAS, but checking if a node is marked as deleted should be done, too. |
@qkrclrl701 I couldn't understand your question... 혹시 한국어로 먼저 얘기할 수 있을까요? |
따라서, insertion의 처음에 Y.next가 mark 되었는지 확인하고, mark 되었다면 abort 해야할 것 같습니다.
답변주신 내용에서는 deletion의 첫 RMW가 성공하면 deletion이 성공한 것이라고 하셨는데, 첫 RMW가 성공하더라도 deletion이 실패하는 상황인 것 같습니다. 단순히 RMW, CAS의 성공 여부만이 아니라, next가 mark 되었는지 또한 확인해야 할 것 같습니다. |
|
명쾌한 답변 감사합니다. 그렇다면, iterate 할 때 delete된 node가 여러 개 있는 경우도 존재할 것 같은데요, 이러한 경우에는 V 이후에 바로 Y로 이동해야 할텐데, 수업시간에 말씀하신대로 W의 next가 mark된지 확인한 뒤에 mark되었으면 W.next로 이동하는 것이 아니라 while loop로 next가 mark 되지 않은 첫번째 node를 찾아 그 node로 이동해야 할 것 같은데 맞나요? |
I think two deletion case is not handled in our algorithm. There was a question about it some days ago but it was buried. |
@qkrclrl701 Yes, during iteration, a thread should (1) skip the marked-as-deleted node, or (2) try to remove the marked-as-deleted node and proceed. |
May I ask if you can elaborate on it? |
Hello @jeehoonkang , |
Yeah I was referring that issue. And think it is not that simple to handle |
In the lecture, it is explained that if compare&set is failed or if node is already marked as deleted , then insertion/deletion will be retried.
I couldn't find those conditions in the slides, if anyone wrote down or took picture of them, could you please share it?
Also, do those retries work without changing arguments of insertion/deletion?
One more question, given X->Y->Z and trying to delete Y, we need to know predecessor of Y to delete Y, so X and Y should be given as an argument, right?
The text was updated successfully, but these errors were encountered: