We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hmm, depending what you are doing with them you are probably missing a barrier which ensures ordering relative to other instructions in the instruction stream. See http://infocenter.ar...ookbook_A08.pdf
It depends what you are using it for TBH. If you are using it like a spinlock (e.g., incref to lock, decref to unlock) then you need barriers after the lock before you touch the memory it is protecting (ensure that the lock is committed before other instructions in the instruction stream can touch the memory) and before the unlock (ensure you've committed data it is protecting to memory before you release the lock). If you don't then you risk race conditions and trampled data (and much painful debugging - trust me). If you are just using it like a reference count then you might get away with it