From: nobu.nokada@... Date: 2004-01-15T13:50:47+09:00 Subject: Re: Nested scopes and the Singleton pattern Hi, At Thu, 15 Jan 2004 13:24:19 +0900, Hal Fulton wrote: > >>First question: Is this a valid way to implement Singleton, or am I > >>overlooking something? > > > > Have you considered about race conditions? > > Thank you, Nobu. No, I did not consider race conditions. > > I suppose singleton.rb is thread safe? Just using Thread.critical. And seems close to your idea excepting for it uses "instance" method rather than "new". -- Nobu Nakada