4ad / go.arm64

Go development tree for the arm64 port (historical).
BSD 3-Clause "New" or "Revised" License
17 stars 3 forks source link

sync/atomic, runtime: re-check all atomic operations #139

Open minux opened 9 years ago

minux commented 9 years ago

It seems our atomic operations might lack memory barriers, as I run misc/cgo/test for enough number of times, test9400 almost always timeout due to missed synchronization (esp. when GOMAXPROCS=8).

test9400 requires some assembly, and I coded in the same way as our sync/atomic functions, so if that test turns out to be wrong, our sync/atomic routines might be wrong too.

davecheney commented 9 years ago

I'd believe that, the number of variations for the LDRX STRX variants available on arm64 is huge, it's easily to believe we're not using exactly the right one

On Sun, Feb 22, 2015 at 1:39 PM, Minux Ma notifications@github.com wrote:

It seems our atomic operations might lack memory barriers, as I run misc/cgo/test for enough number of times, test9400 almost always timeout due to missed synchronization (esp. when GOMAXPROCS=8).

test9400 requires some assembly, and I coded in the same way as our sync/atomic functions, so if that test turns out to be wrong, our sync/atomic routines might be wrong too.

— Reply to this email directly or view it on GitHub https://github.com/4ad/go/issues/139.

4ad commented 9 years ago

FWIW we are using the exact same atomics code as gcc. If we don't, I screwed something up.