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
map不能用cas更新value #42
Comments
PR welcome |
@changkun Is there a way to get the pointer of a value stored in the map, and use CAS to change that? suddenly curious |
@flippedme I don't fully understand your question. Could you please add an example that explains more of your curiosity? |
@changkun Well, for example in an object type People struct{ age int32 }
p := People{}
atomic.CompareAndSwapInt32(&p.age, 30, 35) and I wondered wether we can do the same thing to a map, you know, get-the-address-cas-change pattern. |
@flippedme Aha. Indeed. Sadly, you can't. |
实际描述
预期描述
The text was updated successfully, but these errors were encountered: