Boost logo

Boost :

From: Pete Becker (petebecker_at_[hidden])
Date: 2002-08-06 09:50:44


At 03:33 PM 8/6/2002 +0100, Anthony Williams wrote:

>So with Boost.Threads, you only have dynamic mutex initialization (with
>init order problems), despite the fact that two of the three (I don't know
>anything about MacOS) supported platforms have a mechanism for avoiding
>init order problems with Mutexes?

Put it the other way around: with Boost.Threads you only have dynamic mutex
initialization (with potential init order problems) because one of the
three supported platforms doesn't have a mechanism for statically
initializing mutexes. It's a legitimate limitation.

But: the major compilers for Win32 all have an implementation-specific
mechanism for getting particular functions run before user-defined
constructors. So this issue can be avoided in the implementation of a
lazy_initialization class. Further, it's not necessary to use a mutex
object here; a once function is sufficient.

        -- Pete

Dinkumware, Ltd.
"Genuine Software"


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