Boost logo

Boost :

Subject: Re: [boost] [atomic] boost.atomic library/win32
From: Lars Viklund (zao_at_[hidden])
Date: 2012-08-09 08:26:17

On Thu, Aug 09, 2012 at 01:31:46PM +0200, Tim Blechmann wrote:
> hello helge,
> the shared library of boost.atomic on msvc is currently not really
> usable, as it does not export the pool_.
> atm, all boost.lockfree tests of msvc fail for this reason. also
> according to Zao on irc, it will need some specific treatment to avoid
> the compilation of a static library.
> [1]

The rites I had to perform to get Atomic to build in a way that it was
usable as a DLL was:

In build/Jamfile.v2:
Augment the project requirements and lib with

Create boost/atomic/config.hpp as indicated at [2].

In detail/lockpool.hpp, decorate the lockpool class as:
  class BOOST_ATOMIC_DECL lockpool
and move the member functions that touch pool_ into lockpool.cpp, to
avoid them from getting inlined in consumers.

As a side note, if Boost.Atomic is supposed to be a compiled library, it
should probably implement autolinking as per [3].

I might be off on some things here, but this _should_ make it a good
dynamic Boost library. I'm a bit opposed to requiring something to be
dynamic however, as that kind of implies that you need a dynamic
language runtime.



Lars Viklund | zao_at_[hidden]

Boost list run by bdawes at, gregod at, cpdaniel at, john at