Boost logo

Boost :

From: William E. Kempf (williamkempf_at_[hidden])
Date: 2002-08-07 10:26:43


----- Original Message -----
From: "Peter Dimov" <pdimov_at_[hidden]>
To: <boost_at_[hidden]>
Sent: Wednesday, August 07, 2002 7:56 AM
Subject: Re: [boost] Re: Enhanced call_once()

> From: "Anthony Williams" <anthwil_at_[hidden]>
> > > Is this possible? Without language/memory architecture
> > > support, I mean.
> >
> > See my other post for Win32Mutex and POSIXMutex skeletons that just have
a
> > default constructor.
> >
> > My point is that you can have thread-safe lazy dynamic initialization,
> which
> > works for static objects without causing init-order problems, if you use
> the
> > appropriate primitives for each platform. On POSIX, pthread_once
provides
> > such a mechanism;
>
> pthread_once takes a single void (*) (), there is no way to pass
arguments,
> like the address of the mutex being initialized.

That can be handled through thread specific storage. But this doesn't fix
the static initialization/POD issues.

Bill Kempf


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