RE: JavaMemoryModel: ECMA CLI/C# spec

From: David Holmes (
Date: Fri Dec 21 2001 - 23:16:12 EST

> "A conforming CLI shall guarantee that read and write access to properly
> aligned memory locations no larger than the native word size (the size of
> type native int)is atomic

I don't see the contradiction. Word tearing can occur if bytes are adjacent.
If the bytes are not adjacent but are "properly aligned" then the read/write
is atomic and can't interfere with any other data value. The question in my
mind is what are the rules for alignment of subword variables? For arrays of
subword variables?

> Unless explicit layout control (see Partition II (Controlling Instance
> Layout))is used to alter the default behavior, data elements no larger
> than the natural word size (the size of a native int)shall be properly
> aligned.

That seems to answer that question - so bytes effectively occupy full words?

David Holmes

JavaMemoryModel mailing list -

This archive was generated by hypermail 2b29 : Thu Oct 13 2005 - 07:00:36 EDT