hb: potential causality; causal order: explicit causality?

Peter Veentjer via Concurrency-interest <[email protected]> Sat, 26 Feb 2022 15:36:05 +0200
Newsgroups gmane.comp.java.jsr.166-concurrency
Message-ID <CAGuAWdD7hZkpzsF_SxE_yr6Y8G-RHNwkC60oGF+E_T_vfkUrSw@mail.gmail.com>
--===============6455289152870354188==
Content-Type: multipart/alternative; boundary="0000000000004e974c05d8ebe6b4"

--0000000000004e974c05d8ebe6b4
Content-Type: text/plain; charset="UTF-8"

Hi,

I'm trying to get a better understanding of the causal order. So I'm
posting my understanding of the topic and would like to get feedback if I'm
on the right track.

There are 2 flavors of causality in the space of memory models and
distributed systems:
- potential causality
- explicit causality

In the "Time, clocks, and the ordering of events in a distributed system",
where the happens-before relation is introduced, Leslie Lamport is talking
about potential causality.

So if a->b then a might have affected b.

The happens-before relation from the JMM is about potential causality as
well. E.g.

thread1:
  r1=a (1)
  a=1  (2)

They are ordered by the happens-before relation due to the program order
rule. The happens-before has no clue if (1) and (2) are causally related or
not;  so it just assumes that (1) might have affected (2).

Every execution that is allowed by the JMM has the following 2 constraints:
- (happens before) consistency.
- causality
The primary purpose of causality is to exclude executions with causal loops.

AFAIK this causal order is explicit causality. E.g.

thread1:
  r1=a   (1)
  a=1     (2)

The read (1) doesn't influence the value written at (2), so they are not
ordered by the causal order.

But the following example is one with explicit causality:

thread1:
  r1=a      (1)
  a=r1+1  (2)

The value written is influenced by the value read, so (1) is ordered before
(2) in the causal order.

Is my understanding correct?

PS: One of the papers I'm studying is the "JSR-133 Java Memory Model and
Thread Specification".

Regards,

Peter.

--0000000000004e974c05d8ebe6b4
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>Hi,</div><div><br></div><div>I&#39;m trying to get a =
better understanding of the causal order. So I&#39;m posting my understandi=
ng of the topic and would like to get feedback if I&#39;m on the right trac=
k.<br></div><div><br></div><div>There are 2 flavors of causality in the spa=
ce of memory models and distributed systems:<br></div><div>- potential caus=
ality</div><div>- explicit causality</div><div><br></div><div>In the &quot;=
Time, clocks, and the ordering of events in a distributed system&quot;, whe=
re the happens-before relation is introduced, Leslie Lamport is talking abo=
ut potential causality.</div><div><br></div><div>So if a-&gt;b then a might=
 have affected b.</div><div><br></div><div>The happens-before relation from=
 the JMM is about potential causality as well. E.g. <br></div><div><br></di=
v><div><div>thread1:<br></div><div>=C2=A0 r1=3Da (1)<br></div><div>=C2=A0 a=
=3D1=C2=A0 (2)</div><div><br></div></div><div>They are ordered by the happe=
ns-before relation due to the program order rule. The happens-before has no=
 clue if (1) and (2) are causally related or not;=C2=A0 so it just assumes =
that (1) might have affected (2).</div><div><br></div><div>Every execution =
that is allowed by the JMM has the following 2 constraints:</div><div>- (ha=
ppens before) consistency.</div><div>- causality<br></div><div>The primary =
purpose of causality is to exclude executions with causal loops.</div><div>=
<br></div><div>AFAIK this causal order is explicit causality. E.g.</div><di=
v><br></div><div><div>thread1:</div><div>=C2=A0 r1=3Da=C2=A0=C2=A0 (1)<br><=
/div><div>=C2=A0 a=3D1=C2=A0=C2=A0=C2=A0=C2=A0 (2)<br></div><div><br></div>=
<div>The read (1) doesn&#39;t influence the value written at (2), so they a=
re not ordered by the causal order.<br></div><div><br></div><div>But the fo=
llowing example is one with explicit causality:</div><div><br></div><div><d=
iv>thread1:</div><div>=C2=A0 r1=3Da=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (1)<br></=
div><div>=C2=A0 a=3Dr1+1=C2=A0 (2)</div><div><br></div><div>The value writt=
en is influenced by the value read, so (1) is ordered before (2) in the cau=
sal order.</div><div><br></div><div>Is my understanding correct?<br></div><=
div><br></div><div>PS: One of the papers I&#39;m studying is the &quot;JSR-=
133 Java Memory Model and Thread Specification&quot;.<br></div><div><br></d=
iv><div>Regards,<br><br></div><div>Peter.<br></div><div><br></div><div><br>=
</div><div><br></div></div></div></div>

--0000000000004e974c05d8ebe6b4--

--===============6455289152870354188==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Concurrency-interest mailing list
[email protected]
http://cs.oswego.edu/mailman/listinfo/concurrency-interest

--===============6455289152870354188==--