1. 函数原型: bool __atomic_compare_exchange_n(type *ptr,type*expected,typedesired, bool weak, int success_memorder, int failure_memorder) 函数说明: his built-in function implements an atomic compare and exchange operation. This compares the contents of*ptrwith the contents of*expected. If e...
Here you pose a few questions about __atomic_compare_exchange_n. I'll propose some answers with my arguments for them here. Weak is fine, based on the following: compare_exchange explains "spurious failures" as acting as if the expected ...