Boost logo

Boost :

Subject: Re: [boost] Is there interest in an alternative to the Singleton anti-pattern?
From: Nevin Liber (nevin_at_[hidden])
Date: 2011-06-24 10:33:27


On 24 June 2011 02:06, Ben Robinson <icaretaker_at_[hidden]> wrote:

> If you choose the default policy of single_threaded, there is no
> thread safety, but there is also no overhead in using a mutex and using a
> volatile pointer.
>

Volatile in C++ doesn't really help with threading... Check out <
http://software.intel.com/en-us/blogs/2007/11/30/volatile-almost-useless-for-multi-threaded-programming/>
for one of many articles on the subject.

-- 
 Nevin ":-)" Liber  <mailto:nevin_at_[hidden]>  (847) 691-1404

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