3 ms·
It's not a compare-and-set. Rather, it uses ARM's atomic instructions where the load creates a reservation on the memory address, and the store succeeds only if
by mikeash 13y ago
It's not a compare-and-set. Rather, it uses ARM's atomic instructions where the load creates a reservation on the memory address, and the store succeeds only if the reservation is still present, with any other stores to that address (or nearby addresses) breaking the reservation.
You can use this pattern to implement compare-and-set, but you don't need compare-and-set to use that pattern directly.
Edit: I wasn't sure how to encode this into the steps in the article, so it's a bit vague on that part. Suggestions welcome.
- scott_s 13y agoAlso commonly called load-link, store-conditional: http://en.wikipedia.org/wiki/Load-link/store-conditional http://en.wikipedia.org/wiki/Load-link/store-conditional