Boost logo

Boost :

Subject: Re: [boost] [thread] Can Boost.Thread use Boost.Atomic without falling on a compatibility issue?
From: Andrey Semashev (andrey.semashev_at_[hidden])
Date: 2013-01-13 13:15:34


On Sun, Jan 13, 2013 at 10:04 PM, Vicente J. Botet Escriba
<vicente.botet_at_[hidden]> wrote:
>> The patch also adds some heuristic code for detecting an atomic-compatible
>> integer type to even better avoid using the spinlock pool of Boost.Atomic.
>
> Great. Does it mean that Boost.Thread must link with Boost.Atomic when when
> the spinlock pool is needed?

Yes, Boost.Thread has to link with Boost.Atomic if the spinlock pool
is used. You can always link and hope the linker eliminates the
dependency when not needed.

> Is there a know platform/compiler for which the condition
>
> BOOST_ATOMIC_INT_LOCK_FREE == 2
> || BOOST_ATOMIC_SHORT_LOCK_FREE == 2
> || BOOST_ATOMIC_CHAR_LOCK_FREE == 2
> || BOOST_ATOMIC_LONG_LOCK_FREE == 2
> || (defined(BOOST_HAS_LONG_LONG) && BOOST_ATOMIC_LLONG_LOCK_FREE == 2)
>
> is false?

Any platform not supported by Boost.Atomic. The condition will be
positive on any platform currently supported by Boost.Atomic.

> I have included your implementation conditionally in separated files
> once_atomic.hpp and once_atomic.cpp. I will commit it this evening after I
> run my regression tests and I'll activate your implementation in order to
> see how the Boost regression tests behave. I hope that everything will be
> OK.

Great, thank you.


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