[cpp-threads] pthreads (was: RE: C++ Connections proposal)

Peter Dimov pdimov at mmltd.net
Tue Apr 26 13:35:10 BST 2005


Alexander Terekhov wrote:
> On 4/26/05, Peter Dimov <pdimov at mmltd.net> wrote:
> [...]
>> lock-free code doesn't use non-competing accesses.
>
> It can (in addition to competing accesses).
>
> http://www.decadentplace.org.uk/pipermail/cpp-threads_decadentplace.org.uk/2005-April/000229.html
>
> ----
>   void producer(const T & value) {
>     ELEM * tail = m_tail.load(msync::naked_noncompeting);

Yes, but it uses them in contexts where compiler reorderings, value 
propagation and even word tearing/piecewise loads do not matter, right? So 
the atomic<> wrapper aside, the above is just

    ELEM * tail = m_tail;

and places no restrictions on the compiler. 





More information about the cpp-threads mailing list