什么是“顺序一致的执行没有数据竞争”? [英] What's "sequentially consistent executions are free of data races"?

查看:110
本文介绍了什么是“顺序一致的执行没有数据竞争”?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

JLS,§17.4.5。发生在订单之前 ,它表示


当且仅当所有顺序一致时,程序才能正确同步执行没有数据竞争。

A program is correctly synchronized if and only if all sequentially consistent executions are free of data races.

它只给我们定义顺序一致,它没有给我们定义顺序一贯的执行。只有在知道什么是顺序一致的执行之后,我们才可以进一步讨论这个主题。

It only give us definition about "sequentially consistent", it does not give us definition about "sequentially consistent executions". Only after knowing about what is "sequentially consistent executions", we may make further discussion about the topic.

那么什么是顺序一致的执行以及什么是顺序一致的执行没有数据竞赛?

So what's "sequentially consistent executions" and what's "sequentially consistent executions are free of data races"?

推荐答案

执行有一个非常简单的正式定义:它只是对所有内存操作集合的总排序考虑。

An execution has a very simple formal definition: it is simply a total ordering on the set of all memory actions that is under consideration.

按行动顺序一致的任何总排序表示顺序一致的执行。

A sequentially consistent execution is represented by any total ordering on actions which is sequentially consistent.

术语无数据竞争也由JLS精确定义。

The term "free of data races" is also precisely defined by the JLS.

请注意,JLS不需要顺序一致性。实际上,的整个形式发生在存在之前,以便精确定义顺序不一致的执行可以维持连续一致性错觉的条件。

Note that the JLS does not require sequential consistency. In fact, the whole formalism of happens-before exists in order to define precisely the terms under which sequentially inconsistent executions can maintain an illusion of sequential consistency.

这篇关于什么是“顺序一致的执行没有数据竞争”?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆