-
Notifications
You must be signed in to change notification settings - Fork 13
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
Comments/prior art on Atomic<T>
#7
Comments
I don't define The |
I was not sure where best to comment this RFC draft. I just wanted to throw a library of mine into the discussion: atomig, which main feature is
Atomic<T>
.In
atomig
's case, the trait bounds onT
are a bit more specific and deliberate than in the RFC draft. The docs should explain all the traits fairly well, so I won't repeat myself here.But one important aspect of having more specific traits: some methods, like
fetch_add
andfetch_or
are bounded byAtomInteger
andAtomLogic
traits respectively, which in turn are only implemented for types on which integer operations and logical operations make sense, respectively. With the current draft, one could have anAtomic<f32>
and callfetch_add
on it, but get garbage back, as the atomicadd
operation is an integer addition. Again, I think the docs should explain this nicely.Just wanted to throw that out here.
CC @jswrenn
The text was updated successfully, but these errors were encountered: