Boost logo

Boost :

From: William E. Kempf (williamkempf_at_[hidden])
Date: 2002-08-06 11:56:53


----- Original Message -----
From: "Pete Becker" <petebecker_at_[hidden]>
To: <boost_at_[hidden]>; <boost_at_[hidden]>
Sent: Tuesday, August 06, 2002 11:36 AM
Subject: RE: [boost] Enhanced call_once()

> At 04:50 PM 8/6/2002 +0100, Anthony Williams wrote:
>
> >Now I'm thinking you mean Win32 doesn't have the required support to
avoid
> >init order problems. What is wrong with using named Mutexes?
>
> I don't see what you're getting at. You still have to create the Win32
> mutex, so there's a potential initialization order problem if some other
> object uses the containing object before the Win32 mutex has been created.
> How does using a named mutex affect this?

The principle is that same as how the call_once implementation works today.
Named mutexes are created only once, no matter how many times CreateMutex()
is called, and the kernel enforces proper synchronization of this creation.
It's not static initialization, per se, but it's thread safe lazy
initialization which amounts to the same thing in usage.

Bill Kempf


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