|
Boost : |
Subject: Re: [boost] [atomic] comments
From: Tim Blechmann (tim_at_[hidden])
Date: 2011-11-01 14:00:25
> > the standard says "should" not "must" -- the gcc guys have not made this
> > decision without good reasons, and I agree with these reasons
>
> It says "should" but only for the lock-free case:
>
> [ Note: Operations that are lock-free should also be address-free. That is,
> atomic operations on the same memory location via two different addresses
> will communicate atomically. The implementation should not depend on any
> per-process state. This restriction enables communication by memory that is
> mapped into a process more than once and by memory that is shared between
> two processes. âend note ]
i am neither a native speaker nor a language lawyer. but to me sentence 3 does
not seem to be limited to the lock-free state.
> [ Note: the representation of an atomic specialization need not have the
> same size as its corresponding argument type. Specializations should have
> the same size whenever possible, as this reduces the effort required to port
> existing code. âend note ]
>
> The two recommendations are contradictory, so it's a quality of
> implementation issue.
tim
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk