
19 Dec
2012
19 Dec
'12
10:02 p.m.
On Wed, Dec 19, 2012 at 9:34 PM, Peter Dimov <lists@pdimov.com> wrote:
Incidentally, the mfence in gcc-x86.hpp line 86, in platform_fence_after_load, is unnecessary as well, if I'm not mistaken. The semantics of memory_order_seq_cst are (intentionally) such that it doesn't require fences on the load side, as long as all seq_cst stores or modifications are locked or done with xchg (which has an implicit lock prefix). This also seems to apply to windows.hpp, line 203.
I have committed my fixes as well as removing mfence in platform_fence_after_load. I've also added pause instructions to spin loops to optimize performance and CPU power consumption.