On 09/11/2011 09:00 PM, Geert Bosch wrote:
So, if I understand correctly, then operations using relaxed memory order will still need fences, but indeed do not require any optimization barrier. For memory_order_seq_cst we'll need a full barrier, and for the others there is a partial barrier.
If you do not need an optimization barrier, you do not need a processor barrier either, and vice versa. Optimizations are just another factor that can lead to reordered loads and stores.
Paolo