Why is a store-load barrier considered expensive?
问题 Most CPU architectures will re-order stores-load operations, but my question is why? My interpretation of a store-load barrier would look like this: x = 50; store_load_barrier; y = z; Furthermore, I don't see how this barrier would be have much use in lock-free programming in comparison to release and acquire semantics. 回答1: Short Answer : The store-load barrier prevents the processor from speculatively executing LOAD that come after a store-load barrier until all previous stores have