We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
For the official implementation of Go 1.15, the order between the variables of Load/Store using atomic can be guaranteed.
Package atomic provides low-level atomic memory primitives useful for implementing synchronization algorithms.
The load and store operations, implemented by the LoadT and StoreT functions, are the atomic equivalents of "return *addr" and "*addr = val".
func main() { var a, b int32 = 0, 0 go func() { atomic.StoreInt32(&a, 1) atomic.StoreInt32(&b, 1) }() for atomic.LoadInt32(&b) == 0 { runtime.Gosched() } fmt.Println(atomic.LoadInt32(&a)) }
The printed result of a is always 1, but it is not reflected in the document.
The text was updated successfully, but these errors were encountered:
see #5045
Sorry, something went wrong.
Closing this issue as a duplicate of #5045.
No branches or pull requests
For the official implementation of Go 1.15, the order between the variables of Load/Store using atomic can be guaranteed.
The printed result of a is always 1, but it is not reflected in the document.
The text was updated successfully, but these errors were encountered: