|
Boost : |
From: William E. Kempf (williamkempf_at_[hidden])
Date: 2002-08-06 10:50:35
----- Original Message -----
From: "Anthony Williams" <anthwil_at_[hidden]>
To: <boost_at_[hidden]>
Sent: Tuesday, August 06, 2002 9:33 AM
Subject: RE: [boost] Enhanced call_once()
> > From: Peter Dimov [mailto:pdimov_at_[hidden]]
> > Sent: 06 August 2002 15:17
> > From: "Anthony Williams" <anthwil_at_[hidden]>
> > > > From: Peter Dimov [mailto:pdimov_at_[hidden]]
> > > > Sent: 06 August 2002 14:21
> > >
> > > > From: "Pete Becker" <petebecker_at_[hidden]>
> > > > > In C++ we have automatic initialization of static objects,
> > > > so there is
> > > > even
> > > > > less need for once functions.
> > > >
> > > > We have dynamic initialization of static mutex objects, but
> > > > we do not have
> > > > static initialization of mutex objects. Hello
> > initialization order.
> > >
> > > On POSIX, you can statically initialize a mutex, as mutexes are POD.
> > >
> > > On Windows, mutexes are always dynamically initialized.
> > However, you can
> > > ensure they are only initialized once by using named mutexes.
> > >
> > > I am sure that other platforms have ways of achieving the same aim.
> >
> > Yes. I was talking about the Boost.Threads platform.
>
> 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?
Yes, because those solutions aren't easy to apply to a C++ class design.
I'm working on it, but we don't have this yet.
Bill Kempf
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk