using System;
public sealed class Singleton
{
private static volatile Singleton instance;
private static object syncRoot = new Object();
private Singleton() {}
public static Singleton Instance
{
get
{
if (instance == null)
{
lock (syncRoot)
{
if (instance == null)
instance = new Singleton();
}
}
return instance;
}
}
}
Thursday, September 18, 2014
How to write Singleton pattern in C#?
http://msdn.microsoft.com/en-us/library/ff650316.aspx
Wednesday, September 17, 2014
Monday, September 15, 2014
Optimizing static websites hosted on IIS
- Minify HTML
- Set far-future expiration dates on static resources (JS, CSS, images etc.)
- Use cookieless domains for static files
- Use a CDN
Subscribe to:
Posts (Atom)