Boost logo

Boost :

From: Michael Glassford (glassfordm_at_[hidden])
Date: 2004-04-19 06:19:04

"John Torjo" <john.lists_at_[hidden]> wrote in message
> Dear boosters,
> As far as I've heard a while back, the only reason [thread] library
> cannot be built as a static library was because of TSS.

I'm pretty sure this is correct.

> That to me (and to others as I've seen) seems quite a show-stopper -
> a lot of apps I don't use the [thread] lib just because of this.
Most of
> my multi-threaded applications (around 95%) and as I know a lot of
> multi-threaded apps. don't need TSS.
> Even if they do, usually they don't need advanced clean-up code
> for why [thread] was required to be a DLL). ***Most*** of the time,
> allocated TSS objects can be let to leak resources (which they
> have - mostly IMHO some small amount of allocated memory).

All true enough, perhaps, but in the version of Boost.Thread in the
thread_dev branch (which, as I've mentioned before, I'm slowly merging
into the main branch as I have time), the thread class itself uses tss
rather extensively, which complicates the issue quite a bit.

> The above make me think that we really should enable [thread] to be
> static library again ;). It should be documented in the docs that
> static version of the [thread] runtime will leak TSS objects, and
> can choose whether they will use [thread] as a DLL or as a runtime
> static lib.
> What do others think?

I agree about the desirability of it (I am, in fact, using it that way
myself in some projects). Primarily for the reason I mentioned above,
I'm not sure about the practicality of it in the long run.

I don't know if you remember seeing it, but what do you think about
the approach Roland posted some time back that allowed a static
library to act as if it were a dll?

> As a side-note, allowing the [thread] lib to be a static lib is
> simple (please you gurus out there, correct me if I'm wrong). In
> here's the patch.

[snipped long patch]


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