Skip to content

runtime/internal/atomic: for arm and mips compare-and-swap does not have a memory barrier on failure #63506

@ianlancetaylor

Description

@ianlancetaylor

In the discussion about #63384 we agreed that it would be best if atomic compare-and-swap applied a memory barrier even if the comparison fails. That avoids potential race conditions such as the one described in that issue.

Based on my own inspection, the arm and mips implementation of compare-and-swap do not implement the expected memory barrier. The arm64 and mips64 implementations look OK.

CC @golang/arm @golang/mips @golang/runtime

Metadata

Metadata

Assignees

No one assigned

    Labels

    NeedsFixThe path to resolution is known, but the work has not been done.compiler/runtimeIssues related to the Go compiler and/or runtime.

    Type

    No type

    Projects

    Status

    In Progress

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions