C#에서의 Singleton 구현을 위해 [http://www.yoda.arachsys.com/csharp/singleton.html Implementing the Singleton Pattern in C#]을 읽다가 이상한 것을 발견했다. {{{#!vim cs public sealed class Singleton { static readonly Singleton instance=new Singleton(); // Explicit static constructor to tell C# compiler // not to mark type as beforefieldinit static Singleton() { } Singleton() { } public static Singleton Instance { get { return instance; } } } }}} '''Explicit static constructor to tell C# compiler not to mark type as beforefieldinit''' 이게 무슨 소리? [http://www.yoda.arachsys.com/csharp/beforefieldinit.html 여기]에서 인용한 ECMA335 를 보면, 1. If marked BeforeFieldInit then the type's initializer method is executed at, or sometime before, first access to any static field defined for that type 1. If not marked BeforeFieldInit then that type's initializer method is executed at (i.e., is triggered by): * first access to any static or instance field of that type, or * first invocation of any static, instance or virtual method of that type