Boost logo

Boost :

Subject: Re: [boost] [threads] making parts of Boost.Threads header-only
From: Dmitry Goncharov (dgoncharov_at_[hidden])
Date: 2009-04-08 01:09:49


Anthony Williams wrote:
> Wow, that's a hard line you've drawn there. I'm not sure I agree. The
> only reason this matters is if you're going to be changing the
> implementation and don't want to recompile the code that uses the
> header.
For users compilation time matters as well. Users who don't use
precompiled headers have to recompile
a header only library over and over.
> For boost users, the implementation only changes if they change
> boost versions, and in that case I would expect people to recompile
> anyway --- I wouldn't trust something compiled against boost 1.37 to
> link against a 1.38 lib, for example.
>
> In any case, after further thought I remembered the reason I didn't do
> this before. If the exceptions are header-only then they cannot be
> thrown from a DLL and caught outside the DLL, since the type-ids won't
> match. This would mean that any exceptions thrown by the DLL version of
> boost.thread wouldn't be able to be caught in user code other than by
> catching std::exception or with catch(...). This is the case for
> MSVC/Windows anyway --- I'm not sure about other compilers/platforms.
>
> I could change the code so that if you're linking against the static
> library then the exception functions are inline, since they can't be
> thrown across DLL boundaries anyway in this case. That would mean that
> if you were static linking against boost.thread then you wouldn't
> actually need the lib in some cases (e.g. if all you used was
> boost::mutex).
>
> Anthony
>


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