|
Boost-Build : |
Subject: Re: [Boost-build] x86 CPU spinning should use pause
From: Hite, Christopher (Christopher.Hite_at_[hidden])
Date: 2011-10-04 07:47:05
Sorry for posting to boost-build. I mean to do users.
According to this Intel forum they take different times:
http://software.intel.com/en-us/forums/showthread.php?t=48371
That means they can't be the same instruction. I'd trust their whitepaper.
Pause and no-op are two different use cases. No-ops can allow a debugger to put jumps into the code. This pause instruction means flush out memory operations.
Chris
-----Original Message-----
From: boost-build-bounces_at_[hidden] [mailto:boost-build-bounces_at_[hidden]] On Behalf Of Jeremiah Willcock
Sent: Wednesday, September 28, 2011 7:12 PM
To: Boost.Build developer's and user's list
Subject: Re: [Boost-build] x86 CPU spinning should use pause
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
Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk