$include_dir="/home/hyper-archives/boost-build/include"; include("$include_dir/msg-header.inc") ?>
Subject: Re: [Boost-build] x86 CPU spinning should use pause
From: Jeremiah Willcock (jewillco_at_[hidden])
Date: 2011-09-28 13:12:25
On Wed, 28 Sep 2011, Hite, Christopher wrote:
> #define BOOST_SMT_PAUSE __asm__ __volatile__( "rep; nop" : : : "memory" );
>
> We should probably use:
> __asm__ __volatile__("pause;")
>
> Why? Because one thread polling( or worse CASing) memory, causes multiple overlapping memory operations to be made:
See
http://stackoverflow.com/questions/7086220/what-does-rep-nop-mean-in-x86-assembly
-- basically, "rep; nop" is exactly the same instruction as "pause".
-- Jeremiah Willcock