[cpp-threads] pthreads (was: RE: C++ Connections proposal)
Alexander Terekhov
alexander.terekhov at gmail.com
Tue Apr 26 14:22:24 BST 2005
On 4/26/05, Peter Dimov <pdimov at mmltd.net> wrote:
[...]
> >>> 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;
> >
> > IFF the language does indeed prohibit transforming it to something a
> > la
> >
> > ELEM * tail = ++m_tail, --m_tail; // "as if" m_tail, compiler is just
> > nastily legal
>
> Pretty evil. This is, I believe, an illegal transformation in this
> particular case, but one needs to resort to very arcane language lawyering
> to support that claim, and it's possible to argue the matter for years
> without a definite conclusion.
Note that without definite conclusion (that such transformation is illegal),
pthreads read-write locking (and alike stuff) is nothing but joke, so to
speak.
regards,
alexander.
More information about the cpp-threads
mailing list