[concurrency-interest] Semantics of compareAndSwapX

Andrew Haley aph at redhat.com
Wed Apr 2 07:34:47 EDT 2014


It seems to me that Doug and Hans disagree.

So, I'm going to put this to a vote.

Should CAS on Aarch64 be

	<Access [A]>

	// atomic_op (B)
1:	ldxr	x0, [B]		// Exclusive load
	<op(B)>
	stlxr	w1, x0, [B]	// Exclusive store with release
	cbnz	w1, 1b
	dmb	ish		// Full barrier

	<Access [C]>

or

	<Access [A]>

	// atomic_op (B)
1:	ldxar	x0, [B]		// Exclusive load with acquire
	<op(B)>
	stlxr	w1, x0, [B]	// Exclusive store with release
	cbnz	w1, 1b

	<Access [C]>

or something else?

Please reply with your choice.

Thanks,
Andrew.


More information about the Concurrency-interest mailing list