标签: c concurrency parallel-processing critical-section test-and-set
CMPXCHG语句的工作原理如下:
CMPXCHG (common, old, new): int temp temp <- common if common = old then common <- new return temp
实现a的最简单的算法是什么? 临界区,如果CMPXCHG原子指令可用?