Boost logo

Boost :

From: William E. Kempf (williamkempf_at_[hidden])
Date: 2002-08-08 09:16:10


----- Original Message -----
From: "Andrew J Bromage" <ajb_at_[hidden]>
To: <boost_at_[hidden]>
Sent: Wednesday, August 07, 2002 7:28 PM
Subject: Re: [boost] Enhanced call_once()

> G'day all.
>
> On Thu, Aug 08, 2002 at 09:07:56AM +1000, Andrew J Bromage wrote:
>
> > On some architectures we have an atomic_count operation which would
> > avoid the lock:
>
> ...actually, now that I think about it, this only works if the
> atomic_count operations issue full barriers, which I suppose is not
> guaranteed.
>
> Given that double-checked locking is so hard to get correct and
> portable, I think that's all the more reason to provide an operation
> which _is_ correct and portable, even though it may not be fully
> optimised on platforms where we don't have access to the appropriate
> barrier operations.

That's what call_once is ;).

Bill Kempf


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