Comments (7)
r1 == 0 && r2 == 1
isn't this simply: W1, (the two store ops), W2
from go.
sync/atomic uses AArch64's STLR* instructions.
go/src/internal/runtime/atomic/atomic_arm64.s
Lines 105 to 121 in ac17440
But, arm's hardware memory model allows memory accesses to different addresses to be "Re-order"ed.
https://developer.arm.com/documentation/102376/0100/Normal-memory
from go.
W1, (the two store ops), W2
Sorry, I don't understand. Could you give me some details?
from go.
(I added "R1" and "R2" for convention)
from go.
Sorry, I get it.
You meant R1, W1, W2, R2.
from go.
I fixed my code, and confirmed the test works.
- r1 := atomic.LoadInt32(&x)
- r2 := atomic.LoadInt32(&y)
- if r1 == 0 && r2 == 1 {
+ r1 := atomic.LoadInt32(&y)
+ r2 := atomic.LoadInt32(&x)
+ if r1 == 1 && r2 == 0 {
Thank you for comments!
(Though I'm curious there are correct ordering with arm's STLR/LDAR instructions, I will study it. )
from go.
In my macOS, TSO mode is enabled. So, If I turn it off or use another arm, fixed test may fail possibly.
% sysctl net.inet.tcp.tso
net.inet.tcp.tso: 1
from go.
Related Issues (20)
- x/text/cmd/gotext: gotext does not work with generics HOT 1
- proposal: spec: allow type parameters as type bounds HOT 10
- cls
- proposal: crypto/tls: add ConnectionState.CurveID HOT 1
- cmd/cgo: newline replacement in composite literals generates invalid code HOT 1
- access: request gomote access HOT 1
- fatal error: mSpanList.insert HOT 1
- proposal: add "simd" package to standard library HOT 8
- x/website: HOT 1
- x/pkgsite: package adding request for github.com/wttech/pulumi-aem/sdk HOT 1
- x/pkgsite: package removal request for bitbucket.org/s11006/testmod
- x/text/unicode/runenames: incorrect rune name on the aix-ppc64 builder HOT 5
- cmd/link: panic: machorelocsect: size mismatch [1.22 backport] HOT 1
- x/tools/gopls: make eglot+gopls awesome
- x/build/perf/app/dashboard: automate the branch list HOT 1
- x/build/internal/workflow: TestWatchdog/success failures HOT 1
- cmd/go: TestScript/test_fuzz_minimize_interesting failures HOT 1
- net/http: TestTransportDialCancelRace/h1 failures HOT 1
- net/http/httputil: RoundTripper leaving side effect status code 1XX in responseWriter HOT 1
- proposal: runtime: add `AddCleanup` and deprecate `SetFinalizer` HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from go.