Low-Lock Singletons In D

Idan Arye GenericNPC at gmail.com
Mon May 6 12:25:31 PDT 2013


On Monday, 6 May 2013 at 02:35:33 UTC, dsimcha wrote:
> On the advice of Walter and Andrei, I've written a blog article 
> about the low-lock Singleton pattern in D.  This is a 
> previously obscure pattern that uses thread-local storage to 
> make Singletons both thread-safe and efficient and was 
> independently invented by at least me and Alexander Terekhov, 
> an IBM researcher.  However, D's first-class treatment of 
> thread-local storage means the time has come to move it out of 
> obscurity and possibly make it the standard way to do 
> Singletons.
>
> Article:
> http://davesdprogramming.wordpress.com/2013/05/06/low-lock-singletons/
>
> Reddit:
> http://www.reddit.com/r/programming/comments/1droaa/lowlock_singletons_in_d_the_singleton_pattern/

Thanks!

I want to make a module with template mixins that implement some 
common idioms - singleton being one of 
them(http://forum.dlang.org/thread/fofbrlqruxbevnxchxdp@forum.dlang.org). 
I'm going to use your version for implementing the singleton 
idiom.


More information about the Digitalmars-d mailing list