|
Boost : |
Subject: Re: [boost] [atomic] comments
From: Peter Dimov (pdimov_at_[hidden])
Date: 2011-11-01 09:06:46
Helge Bahmann wrote:
> 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 ]
It also says:
[ 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.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk