ECMA-334 C# Language Specification

10.10: Execution order

Execution shall proceed such that the side effects of each executing thread are preserved at critical execution points. A side effect is defined as a read or write of a volatile field, a write to a non-volatile variable, a write to an external resource, and the throwing of an exception. The critical execution points at which the order of these side effects must be preserved are references to volatile fields (17.4.3), lock statements (15.12), and thread creation and termination. An implementation is free to change the order of execution of a C# program, subject to the following constraints: