Skip to content
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

Expose asymmetric_light_barrier and explain its usage #55

Open
powergee opened this issue Nov 20, 2023 · 0 comments · May be fixed by #56
Open

Expose asymmetric_light_barrier and explain its usage #55

powergee opened this issue Nov 20, 2023 · 0 comments · May be fixed by #56

Comments

@powergee
Copy link

We sometimes need to directly use the protect_raw function in HazardPointer, especially to implement some data structures where protection is validated in a different way. Michael-Scott queue or DoubleLink Queue are good examples. To implement those with plain hazard pointers, after protecting the next node of the head node, its validation must be done by checking the entry pointer to the head node again. This is because the next pointer on the head node won't be changed even after the nodes are dequeued and retired.

However, as the internal light barrier implementation is not public, we cannot synchronize the reading thread with the reclaiming thread. Of course, using fence(Ordering::SeqCst) might be enough, because the current implementation of the light barrier is just a sequential normal barrier. Nonetheless, It would be good to allow users to call the light barrier functionality and explain its usage in a document.

In conclusion, I think that someone(or me) should do the following jobs:

  • Make asymmetric_light_barrier public and explain its usage.
  • In the document of protect_raw, suggest an example using with asymmetric_light_barrier.
@powergee powergee linked a pull request Nov 22, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant