Re: JavaMemoryModel: prescient write question

From: Bill Pugh (pugh@cs.umd.edu)
Date: Fri Jul 05 2002 - 17:18:19 EDT


>Is it a legitimate concern that the behavior in Case 2 is too relaxed
>if the read obtains its value from a future write on the _same_
>variable from the same thread?
>
>-- Jason

I don't think so. The fact that the same variable is being used isn't
particularly significant.

I'm getting a lot of pressure from several people not to impose any
constraints in the memory model unless they are well motivated. I
can't see any motivation for forbidding r1 == r2 == 1 in case 2.

> > At 9:56 AM -0600 7/2/02, Yue Yang wrote:
>> >Bill,
>> >
>> >Does your semantics allow r1 = 1 in the following cases?
> > >
> >> >
>> >* Case 2:
>> >
>> >Thread 1 Thread 2
>> >
>> >r1 = x; r2 = x;
>> >x = 1; x = r2;
>> >
>> >
>> >It's not clear if x = r2 would use the same GUID as x = 1 or if it would
>> >use a different GUID since assignment with local varialbes is not
>> >explicitly discussed in your semantics.
>> >
>> >Thanks!
>> >
>> >-- Jason
> > >
-------------------------------
JavaMemoryModel mailing list - http://www.cs.umd.edu/~pugh/java/memoryModel



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