Hi!
I have a simple question: "Is the code below threadsafe "
public class MyType
{
...
private static readonly MyType p_instance;
public statict MyType Instance
{
get { return p_instance; }
}
static MyType()
{
p_instance = new MyType();
}
private MyType()
{
}
...
}

Singleton and multithreading
knackpunkt83
Yes, it's thread safe. The static constructor is called only once for a given type.
You might find the following page about singletons to be useful:
http://www.yoda.arachsys.com/csharp/singleton.html
Toan