RE: JavaMemoryModel: ECMA CLI/C# spec

From: Boehm, Hans (
Date: Fri Dec 21 2001 - 13:34:24 EST

> -----Original Message-----
> From: Bill Pugh []
> The CLI/C# spec is done, and is available from:
> (C# spec)
> (CLI spec)
> (CLI libraries?)
> The CLI memory model is described on pages 92-95 of partition I of
> the CLI spec.
> ...
> * Word tearing is defined to occur. If threads write
> adjacent bytes
> without synchronization, it is a data race and one of the writes may
> be lost.
Reading section 11.7, I come to the same conclusion that you did. But
11.6.6 states:

"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 (see clause 11.6.2). Atomic writes shall alter no
bits other than those written. 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. Object references shall be treated as though
they are stored in the native word size."

This leads me to the opposite conclusion. Has someone understood how to
reconcile these? Did I miss something?

JavaMemoryModel mailing list -

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