<i>__sync_fetch_and_add, __sync_add_and_fetch, __sync_val_compare_and_swap, and friends provide a full barrier so “no memory operand will be moved across the operation, either forward or backward.” These operations are the basis for most (all?) lock-free algorithms.</i><p>What's lock-free about that? It sounds like locks to me, only you don't implement them yourself. What am I missing?