Boost logo

Boost :

From: Tobias Schwinger (tschwinger_at_[hidden])
Date: 2007-08-10 04:31:05

Replied off-list, yesterday. Forwarding to the (slightly edited) message
to the list:

Johan Franzén wrote:
> Hi boosters and Tobias,
> I'm in search of a singleton working with multi-threading. I've
> tried Loki's SingletonHolder, but that one doesn't seem to work
> with code executed before start of main(), at least not with
> the ClassLevelLockable ThreadingModel, but it might as well be
> my bad as it's not really very well documented (I don't have
> an MC++D handy). Anyhow; I stumbled upon the singleton in
> boost vault/X-Files which felt promising after reading the docs.
> But it seems to also require some Boost.FunctionTypes library
> which seems to be kind-of-almost accepted into boost (See

FunctionTypes is a boost library now. It will be part of Boost 1.35.

> So now to my questions:
> * Is this singleton in vault/X-Files working and worth a try?

Yes, I hope so (the test suite is known to pass with MacOS X / GCC4 and
Vista / MSVC8).

'thread_specific_singleton' is currently not working reliable with some
platforms because of (what seems to be) a bug in Boost.Thread.

> Or is it more of a scetch or something?

No it's finished, but it's pretty new, still. BTW: For this reason I'd
be thankful for some feedback :-).

> * If yes, how can i get a copy of its prerequisite
> function_types?

I've just uploaded a backport to Boost 1.34 to the vault:

> And are there more prerequisites not in the
> 1.34.1 release?


> * Can I use the 1.34.1 boost release and patch in the needed
> files?


> * Is the singleton scheduled for a review? There really ought
> to be a singleton in boost!

Planned to be scheduled for review.

> * Last resort - if this singleton isn't really usable as is,
> does anyone know of one that is and fits my requirements
> above?

The only ones I can currently think of are those in Loki...


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