On Sep 23, 6:49 pm, Eugene Zolenko <[email protected]> wrote:

> Volatile is fixed in latest version of cryptopp already.

I can see the fix in SVN trunk, though not in the latest release.

>
> s_pObject.m_p being NULL is bad. I thought it would just leak one
> pointer in worst case...

The root of problem is non-POD static, which is initialized
dynamically.
static simple_ptr<T> s_pObject;
If static non-PODs were thread-safe, we would not have the problem of
implementing singleton.

>
> I think main reason not to use locks is to avoid writing whole wrapper
> around platform specific API for initialization of one singleton.
> (Although just win32 and pthread should cover most of the platforms
> cryptopp supports.)

Handling threading of each supported platform is needed. Otherwise,
the code is not thread safe.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the "Crypto++ Users" 
Google Group.
To unsubscribe, send an email to [email protected].
More information about Crypto++ and this group is available at 
http://www.cryptopp.com.
-~----------~----~----~----~------~----~------~--~---

Reply via email to