Re: JavaMemoryModel: Javadoc terminology for synchronization

From: Jerry Schwarz (jerry.schwarz@oracle.com)
Date: Thu Apr 01 2004 - 12:37:22 EST


At 06:55 AM 4/1/2004, Bill Pugh wrote:
>After talking with Doug, and reviewing the options that have been suggested,
>we are both leaning towards "synchronizes with" for javadoc-level descriptions
>of synchronization semantics.
>
>To avoid the problem that "synchronizes with" sound symmetric, it should
>always
>be used in a context such as
>
> ... synchronizes with (a | any | all) (preceding | following) ...
>
>For example,
> A write to a volatile synchronizes with all following reads of
> that volatile.

This still sounds symmetric to me. In particular it suggests that after

     int x; volatile int v;
     ...
     x = 1;
     r = v;

The assignment to x is visible to the thread that wrote the value read by v.

Put another way it sounds identical to

     A read of a volatile synchronizes with all previous writes of that
volatile.

> Interrupting a thread synchronizes with all following events that
> detect that the thread has been interrupted (e.g., the interrupted
> thread throwing an InterruptedException, or a invocation of
> interrupted()
> returning true).
>
>Doug and I both felt that terminology such as "makes visible to" or
>"is ordered before" wouldn't be well suited towards the target audience
>for JavaDoc.
>
>We are still open to suggestions if you come up with a really good one.
>
>
> Bill
>
>-------------------------------
>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:02 EDT