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

Should we support operators (like + and + reduce) on atomics? #16239

Open
bradcray opened this issue Aug 13, 2020 · 3 comments
Open

Should we support operators (like + and + reduce) on atomics? #16239

bradcray opened this issue Aug 13, 2020 · 3 comments

Comments

@bradcray
Copy link
Member

Issues #16237 and #16238 propose convenience features for implicitly reading atomics and supporting special operators on them that map to their methods. This issue asks whether we should support things like + on two atomics or + reduce on an array of atomics. It may be that these will just fall out if we adopt #16237, or they may require extra work. Would such support round out our atomic story or be a bridge too far?

@ronawho
Copy link
Contributor

ronawho commented Aug 14, 2020

I think this will fall out from #16237 and #16238. I'm in favor of both of those, but even if we don't end up implementing them, I'd be in favor of supporting this since it seems like a common case. The main argument against supporting operator overloads for atomics is wanting it to be very visible that atomic operations are happening, but I don't think that applies in the reduction case.

Related to (and possibly duplicates) #12549

@gbtitus
Copy link
Member

gbtitus commented Aug 17, 2020

Agreed, I don't think there's any downside to implementing operators on atomics that will only require reading/loading from them.

@damianmoz
Copy link

I would add my voice to those of @ronawho and @gbtitus in what you are suggesting for both this and the two other related issues, All of these issues did remind me to look at which is doing Rust on this topic.

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

No branches or pull requests

4 participants