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

[Feature Request] strong variant of box-cas! #3936

Open
sorawee opened this issue Jul 23, 2021 · 3 comments
Open

[Feature Request] strong variant of box-cas! #3936

sorawee opened this issue Jul 23, 2021 · 3 comments
Labels
feature request Feature Request

Comments

@sorawee
Copy link
Collaborator

sorawee commented Jul 23, 2021

box-cas! is weak in a sense that there could be a spurious failure. It would be nice to have a strong variant that guarantees no failure in the standard library.

@sorawee sorawee added the feature request Feature Request label Jul 23, 2021
@samth
Copy link
Sponsor Member

samth commented Jul 23, 2021

I'm not sure this is a good idea. Most algorithms that use CAS are going to want to have some non-trivial backoff strategy, rather than just busy-looping.

@sorawee
Copy link
Collaborator Author

sorawee commented Jul 23, 2021

I will let other people who know about concurrency algorithm more than I do weigh in on this (@Bogdanp?), but it seems standard for languages to provide this function (e.g. C++, Rust). I myself simply try to fix bugs that occur due to unexpected spurious failure (see, e.g., emina/rosette#199) and think it would be nice if I don't have to manually loop by myself.

@samth
Copy link
Sponsor Member

samth commented Jul 23, 2021

Ah, I didn't realize you only wanted to avoid spurious failure. That seems reasonable to provide.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Feature Request
Projects
None yet
Development

No branches or pull requests

2 participants