Boost logo

Boost :

Subject: Re: [boost] [lockfree] review
From: Alexander Terekhov (terekhov_at_[hidden])
Date: 2011-08-27 10:59:16


Peter Dimov wrote:
>
> Alexander Terekhov wrote:
>
> > Consider also that
> >
> > "Load Seq_Cst: MOV (from memory)
> > Store Seq Cst: (LOCK) XCHG // alternative: MOV (into memory),MFENCE"
> >
> > is an overkill for typical use cases...
>
> But that's not a problem because everyone who understands should use
> explicit constraints, even if they happen to be memory_order_seq_cst.
> Relying on the SC default is bad practice because it can (and, to be on the
> safe side, should) be interpreted to mean that the author just hasn't
> figured out the minimum requirements.

I think that atomic<>'s memory order default should express minimum
requirements, not maximum (SC).

regards,
alexander.


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