Boost logo

Boost :

Subject: Re: [boost] Notice: Boost.Atomic (atomic operations library)
From: Helge Bahmann (hcb_at_[hidden])
Date: 2009-12-01 04:36:40


Hello Mikael,

On Tue, 1 Dec 2009, Mikael Olenfalk wrote:
> Hello Helge,
>
> I am trying to use Boost.Atomic in my project but am experiencing the
> following two problems:
>
> - boost/atomic/memory_order.hpp: enum memory_order is redeclared
> from boost/memory_order.hpp (1.37)

Yes, I realized that today; the definition in boost/memory_order.hpp is
outdated, it should be replaced with boost/atomic/memory_order.hpp or
augmented to include "memory_order_consume" (it is contained in more
"recent" proposals of the C++0x standard, see
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2643.html).

> + however boost/memory_order.hpp does not define
> memory_order_consume, from a quick glance however that enum value
> does not seem to be used (it appears in some switch
> statements but only as a fallthrough) so I simply removed
> boost/atomic/memory_order.hpp and removed all uses of
> memory_order_consume

it *is* used, to force a memory barrier on alpha (where many other
architectures don't need one). Don't remove it, this is wrong.

> - boost::atomic<T>::atomic() and boost::atomic<T>::atomic(T v)
> declare the variable "verify_valid_atomic_integral" but never use it
> which breaks -Werror
> + to fix this I simply added the line
> "(void)verify_valid_atomic_integral;" to both constructors

This is a placeholder to verify that the passed type is in fact an
integral type (lots of things break if it is not) -- this is not the best
way to achieve it, I plan to refactor the code and remove it entirely (but
will not be in the repository until this evening).

Thanks for testing & best regards
Helge


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