简体   繁体   中英

Internal implementation of atomic_cas_64() on Solaris on Sparc?

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?

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.

您可以看一下SPARCSPARCv9的实现,以确切地了解它们的作用……您应该看一下membar_ *函数(在同一文件中),看看可以做些什么来获得更强有力的保证。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM