Oh yeah, and this one:

> http://cgit.asynk.ch/cgi-bin/cgit/hydrogen/commit/?h=jeremyz&id=64ca3c1be299595071e1ad7cd0d6762c224a426d

Has this snipped of code:

template<typename T>
T& Singleton<T>::Instance() {
     if ( Singleton::_instance == 0 ) {
         Singleton::_instance = new T();
     }
     return *(Singleton::_instance);
}

We specifically removed this when trying to figure out our 
issues.  (The so-called "jack zombies" issue... if you 
search the archives.)  It was removed for two reasons:

1. The "lazy instantiation" method was backfiring
    on us... having things get created at bad times.
    People startied calling T::Instance() just to
    get the constructor called explicitly in
    the startup code.

2. Having 'new T' made it next to impossible to
    conduct a static code review to make sure that
    we didn't make any real-time violations.
    Removing 'new T' and providing another method
    for explicit instantiation made the audit go
    /much/ faster.

Peace,
Gabriel

------------------------------------------------------------------------------
Return on Information:
Google Enterprise Search pays you back
Get the facts.
http://p.sf.net/sfu/google-dev2dev
_______________________________________________
Hydrogen-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/hydrogen-devel

Reply via email to