
5 Apr
2007
5 Apr
'07
2:40 p.m.
2007/4/5, Jeff Garland <jeff@crystalclearsoftware.com>:
Yeah sure, classic Meyer's singleton. Couple problems. It's not thread safe
It may be not thread safe. If it is first called in the "single thread initialization phase"(or a term like that) there wil be no thread safty problem, but no "lazy instantiation" as well.
and you could easily inline this code into multiple translation units.
I don't agree. Compiler should not make multiple instances of a <b>static local</b> variable,
In both cases you might wind up with multiple copies of your singleton in the process. It's this sort of thing that makes true singletons devilishly hard to do...