F# compiles this code to a single class with a .cctor (class initializer) method. The CLI execution environment (e.g. .NET or Mono) will ensure that the class initializer is only run once. It will be be run under a lock on the first thread that "triggers" the initialization. CLI execution environments tend to have quite a lot of cleverness about placing checks for triggers at sensible places and eliminating the triggers when they are provably not needed.

The F# spec gives some more details.

Kind regards

don

By on 6/25/2009 2:13 PM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper