Golang Compare and Swap Usage
Tonight’s @risc_v Tip (feat. @golang):
Go uses a compare and swap (CAS) implementation similar to the example provided in the RISC-V unprivileged spec. The Go assembler always uses acquire access (aq=1
) to align with the language’s memory requirements.