Boost logo

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:
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.


-----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:

-- basically, "rep; nop" is exactly the same instruction as "pause".

-- Jeremiah Willcock

Boost-Build list run by bdawes at, david.abrahams at, gregod at, cpdaniel at, john at