On 64-bit Solaris on Sparc, is the atomic_cas_64() function call implemented using load-link/condition-store?
If not, what if any API does Solaris offer for user-mode C code to utilize ll/sc?
On 64-bit Solaris on Sparc, is the atomic_cas_64() function call implemented using load-link/condition-store?
If not, what if any API does Solaris offer for user-mode C code to utilize ll/sc?
You could have a look at the SPARC and SPARCv9 implementations to see exactly what they do... you should have a look at the membar_* functions (in the same files) to see what you can do to have stronger guarantees.
Sparc64 - alone amongst modern CPUs - implements neither double wide CAS nor LL/SC. As such, implementing lock-free code is problematic. There a solutions, but they are solutions to a problem (ABA) which does not exist on other platforms because of their support for CAS or LL/SC. Furthermore, a range of lock-free algorithms cannot be implemented on Sparce because of this limitation.