Freigeben über


CLR Memory Model

Internally and externally I see a lot of questions about the .Net Memory Model.  I think a lot of the confusion comes from the specs.  Mainly that there are really two of them.

The first is the ECMA CLI Memory Model (Partition 1, Section 12).  This standard introduces a relaxed memory model which, IMHO, makes multi-threading program a bit difficult.  For instance it allows for write reordering which can be quite confusing to programmers (and result in very hard to track bugs).

The CLR 2.0 Memory Model is a stricter version of the EMCA model.  There are two excellent sources of information on the more strict version.

For anyone doing multi-threaded programming in .Net, both of these articles are a must read.

Comments