At 10:34 AM -0800 12/21/01, Boehm, Hans wrote:
> > -----Original Message-----
> > 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?
There does seem to be a conflict. My best guess is that they simply
forgot to update Section 11.7.
However, if asked to interpret the existing spec, the 2nd bullet of 11.7 says:
* one and two byte data that does not cross a would boundary will
be read atomically, but writing may write the _entire_ word back to
memory.
So, since 11.7 says that writing a byte writes the entire word,
section 11.6.6 simply says that no bits other than the bits in that
word will be updated.
Bill
-------------------------------
JavaMemoryModel mailing list - http://www.cs.umd.edu/~pugh/java/memoryModel
This archive was generated by hypermail 2b29 : Thu Oct 13 2005 - 07:00:36 EDT