Boost logo

Boost :

Subject: Re: [boost] [spinlock] Spin on volatile read, NUMA fairness?
From: Peter Dimov (lists_at_[hidden])
Date: 2014-12-04 07:45:52


Gavin Lambert wrote:
> Out of curiosity, while I agree that the latter is better than the former,
> how would this compare:
>
> while( f_.exchange( true, std::memory_order_acquire ) )
> {
> while( f_.load( std::memory_order_relaxed ) )
> {
> /* maybe yield */
> }
> }

I think that you're right, this should indeed be better.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk