RE: JavaMemoryModel: How about "Synchronizes to" and "Synchronize s from"

From: Jerry Schwarz (jerry.schwarz@oracle.com)
Date: Fri Mar 26 2004 - 19:42:06 EST


At 01:43 PM 3/26/2004, Boehm, Hans wrote:
>At the cost of using a longer phrase, how about something like
>"provides memory visibility to" or "provides visibility to".
>It seems to me that's a more accurate description.
>
>That's similar to the Intel "made visible" terminology that Thomas Wang
>pointed at, but I think it more accurately describes the Java semantics.

I agree that something reflecting memory actions is better because it is
closer to the way programmers tent to think. I prefer "flushes writes
to" over "provides visibility to" but eacher is better than "synchronizes
...".

"flushes writes to" may not be 100% technically accurate, but it's close
enough and I think it's almost self explanatory.

>Hans
>
> > -----Original Message-----
> > From: owner-javamemorymodel@cs.umd.edu
> > [mailto:owner-javamemorymodel@cs.umd.edu]On Behalf Of Victor Luchangco
> > Sent: Friday, March 26, 2004 8:17 AM
> > To: Bill Pugh
> > Cc: javamemorymodel-cs.umd.edu
> > Subject: Re: JavaMemoryModel: How about "Synchronizes to" and
> > "Synchronizes from"
> >
> >
> > Bill Pugh wrote:
> > > We've discussed needing some phrase we can use instead of
> > > "creates a happens-before edge" in places such as
> > > Javadoc.
> > >
> > > One proposal was "Synchronizes with", but I don't like that because
> > > it sound symmetric, and doesn't convey the directed nature of
> > > synchronization.
> > >
> > > So what do you think about "synchronizes to" (and
> > "synchronizes from")?
> > >
> > > For example,
> > > starting a thread synchronizes to the run method of the thread
> > > successful joining with a thread synchronizes from the
> > run method of
> > > the thread
> > >
> > > -------------------------------
> > > JavaMemoryModel mailing list -
> > http://www.cs.umd.edu/~pugh/java/memoryModel
> >
> > I dislike the use of "to" and "from" with synchronized. It sounds
> > unnatural to me, and I wouldn't know what it meant. I can easily
> > infer the meaning in this case, but that's no better than using
> > "synchronized with", which at least sounds better.
> >
> > Did we decide that using "happens-before" (with hyphen) was too
> > subtle and likely to be missed?
> >
> > starting a thread happens-before the run method of the thread
> >
> > (Of course, that would not give us the inverse relation without
> > another definition. But we could define happens-after to be that
> > inverse.)
> >
> > If the desire is to avoid sounding too technical, then perhaps:
> >
> > starting a thread must occur before the run method of the thread
> > successful joining with a thread must occur after the run method...
> >
> > In all the above examples, I think "the run method" should really
> > be replaced with a specific event, e.g., "starting a thread must
> > occur before the invocation of the run method..."
> >
> > If retaining "synchronized" is important, then perhaps we can say
> >
> > starting a thread is synchronized before the invocation of ...
> > successful joining with a thread is synchronized after ...
> >
> > The main objection I have to this last version is that "synchronized"
> > implies a similarity in time, so "synchronized before/after" is an
> > oxymoron of a sort. Of course, we are using the term in a technical
> > sense, so we can have it mean whatever we want. But using that
> > reasoning, I think we should just revert to using the technical
> > happens-before relation.
> >
> > Victor
> > -------------------------------
> > JavaMemoryModel mailing list -
>http://www.cs.umd.edu/~pugh/java/memoryModel
>-------------------------------
>JavaMemoryModel mailing list - http://www.cs.umd.edu/~pugh/java/memoryModel

-------------------------------
JavaMemoryModel mailing list - http://www.cs.umd.edu/~pugh/java/memoryModel



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