Lock-free is a property, not a performance result
A lock-free algorithm guarantees system-wide progress. It says nothing about cache-line ping-pong, failed CAS loops, fairness or tail latency under contention.
A well-designed single-writer model can outperform an impressive lock-free structure because it avoids shared writes altogether. The fastest atomic operation remains the one you did not need.
Common failure modes
- multiple producers hammering the same cache line,
- CAS retry storms under bursty load,
- incorrect memory ordering stronger than required,
- complex reclamation strategies dominating the useful work.
Choose the execution model first
Define ownership, communication direction and boundedness before selecting atomics. SPSC queues, thread-per-core execution and batching often solve the actual problem with less coherence traffic.