Understanding Memory Reordering
internalpointers.com
internalpointers.com
If you think you need lock-free, usually what you really need is less contention, or a single-writer ring buffer.
Sometimes lock-free is right, and sometimes locking is right. But it can be worth quite a lot to find a way not to need either one.