java - JMM 中的执行和因果关系要求

标签 java multithreading concurrency

这里 http://docs.oracle.com/javase/specs/jls/se8/html/jls-17.html#jls-17.4.8

是什么意思 hbi|Ci = hb|Ci

soi|Ci = so|Ci

和 对于 Ai - Ci-1 中的任何读取 r,我们有 hbi(Wi(r), r)

为什么他们从 Ci-1 中减去 Ai - 或者它是某种范围?

对于 Ei 来说,什么是足够的同步边缘?

最佳答案

what does it mean hbi|Ci = hb|Ci, soi|Ci = so|Ci

也许您错过了您引用的部分顶部的定义:

We use f|d to denote the function given by restricting the domain of f to d. For all x in d, f|d(x) = f(x), and for all x not in d, f|d(x) is undefined.

We use p|d to represent the restriction of the partial order p to the elements in d. For all x,y in d, p(x,y) if and only if p|d(x,y). If either x or y are not in d, then it is not the case that p|d(x,y).

For any read r in Ai - Ci-1, we have hbi(Wi(r), r)

为什么他们从 Ci-1 中减去 Ai - 或者它是某种范围?

这是集合减法,意味着 Ai 中的元素不存在于 Ci-1 中。

what is sufficient synchronizes-with edges for Ei?

我在这里不是100%确定,但这可能意味着足以建立完全同步顺序的集合。基本上,对于任何一对 sw 边 sw(a,b)sw(b,c),额外的 sw(a,c) em> 将是多余的(超出了足够的范围)。

更新

实际上,我错过了紧随该术语使用下方的正式定义:

8. Let sswi be the swi edges that are also in the transitive reduction of hbi but not in po. We call sswi the sufficient synchronizes-with edges for Ei. If sswi(x, y) and hbi(y, z) and z in Ci, then swi(x, y) for all j ≥ i.

这意味着所有可以从程序顺序 (po) 推断出的 sw-edges 也将被删除。

关于java - JMM 中的执行和因果关系要求,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25592268/

相关文章:

java - Java 验证中的正则表达式帮助

Java for 循环星号

c# - 在 .NET 中使用 Interlocked 类进行多线程处理的正确方法

concurrency - 用于潜在递归任务的工作池(即每个作业可以对其他作业进行排队)

java - 这是在 Java 中创建锁的可接受方式吗?

java - 在调用两种方法之间随机选择

java - 将 Spring 与 App Engine 结合使用

c# - C# 中的线程、值类型和引用类型说明?

multithreading - MPI和pthreads : nodes with different numbers of cores

c++ - c\c++中线程和并发中一本好的编程书籍推荐