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
> http://lists.boost.org/boost-announce/2005/06/0066.php).

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

     http://www.boost.org/more/formal_review_schedule.html

> 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:

    http://tinyurl.com/qaf5f

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

No.

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

Yes.

> * 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...

Regards,
Tobias


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