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.

21-11-09_1


21-11-09_2


21-11-09_3


21-11-09_4

Original Tweet