Data Dependency
https://en.wikipedia.org/wiki/Data_dependency
(There’s some misleading expression on the flow/data dependency statement.)
1, what is data dependency
A data dependency in computer science is a situation in which a program statement (instruction) refers to the data of a preceding statement.
2, Bernstein Condition
The Bernstein Condition defines what data dependency’s logic format:

If above conditions are met, we say S2 depends on S1.
3, types
There’re 3 types of data dependencies: ante-dependency, flow(data) dependency and output dependency.
Their definitions as followed:
(1) ante-dependency
definition: I(S1) AND O(S2), S1->S2, S1 reads a memory location before S2 writes it.
To be more specific, S1->S2 means this is the correct order that S1 reads first before S2 writes, otherwise there may be execution error.
This is also known as WAR, writer-after-read.
Be aware that WAR is not an error; we should not confuse it with WAR hazard.
WAR hazard is a ‘hazard’, and WAR is the rule that’s violated that caused the hazard. The hazard happens because the rule of WAR is not followed.
Let’s see an example below:
1, B = 3
2, A = B+1
3, B = 7
(2, 3) is an ante-dependency example.
In this example, S1 is (A=B+1), and S2 is (B=7), so I(S1) targets memory B (read from B), and O(S2) also targets memory B(write to B).
(2) flow/data dependency
definition: O(S1) AND I(S2), S1->S2, S1 writes a memory location before S2 reads it.
This is also named as RAW. Some people also call this true data dependency.
Note: Statement in wikipedia is a little misleading.
(3) output dependency
definition: O(S1) AND O(S2), S1->S2, both write to the same memory location
This is WAW.
4, how to reduce data dependency
One of the disadvantages is data dependency may hinder parallelism. One of the ways to avoid that is :
(1) use scoreboarding to avoid RAW;
(2) use register renaming to cover WAR and WAW.
Data Dependency的更多相关文章
- How to bind to data when the DataContext is not inherited【项目】
http://www.thomaslevesque.com/2011/03/21/wpf-how-to-bind-to-data-when-the-datacontext-is-not-inherit ...
- data hazard in CPU pipeline
1, background info 5 stages in CPU pipeline: IF, ID, EX, MM, WB IF – Instruction Fetch ID – Instruct ...
- 初识pipeline
1.pipeline的产生 从一个现象说起,有一家咖啡吧生意特别好,每天来的客人络绎不绝,客人A来到柜台,客人B紧随其后,客人C排在客人B后面,客人D排在客人C后面,客人E排在客人D后面,一直排到店面 ...
- Falcon Genome Assembly Tool Kit Manual
Falcon Falcon: a set of tools for fast aligning long reads for consensus and assembly The Falcon too ...
- C11 memory_order
概念: 摘录自:http://preshing.com/20120913/acquire-and-release-semantics/ Acquire semantics is a property ...
- springdata+redis配置详解
springdata设计初衷是位简化数据类型和数据的持久化存储,它并不局限是关系型数据库还是nosql数据库,都提供了简化的数据库连接,让数据获取变得更加的简单.所有这些的实现有统一的api提供. 本 ...
- The JSR-133 Cookbook for Compiler Writers(an unofficial guide to implementing the new JMM)
The JSR-133 Cookbook for Compiler Writers by Doug Lea, with help from members of the JMM mailing lis ...
- 用Go造轮子-管理集群中的配置文件
写在前面 最近一年来,我都在做公司的RTB广告系统,包括SSP曝光服务,ADX服务和DSP系统.因为是第一次在公司用Go语言实现这么一个大的系统,中间因为各种原因造了很多轮子.现在稍微有点时间,觉着有 ...
- Golang源码探索(三) GC的实现原理
Golang从1.5开始引入了三色GC, 经过多次改进, 当前的1.9版本的GC停顿时间已经可以做到极短. 停顿时间的减少意味着"最大响应时间"的缩短, 这也让go更适合编写网络服 ...
随机推荐
- mysql数据库中的索引介绍与优化(转)
一.什么是索引? 索引用来快速地寻找那些具有特定值的记录,所有MySQL索引都以B-树的形式保存.如果没有索引,执行查询时MySQL必须从第一个记录开始扫描整个表的所有记录,直至找到符合要求的记录.表 ...
- 基于Netty的RPC架构学习笔记(一):NIO
文章目录 传统的socket分析 举个
- jquery操作html元素之( 获取并设置 CSS 类)
jQuery 操作 CSS jQuery 拥有若干进行 CSS 操作的方法.我们将学习下面这些: addClass() - 向被选元素添加一个或多个类 removeClass() - 从被选元素删除一 ...
- spark-sql createOrReplaceTempView 和createGlobalTempView区别
在讲解 createOrReplaceTempView 和createGlobalTempView的区别前,先了解下Spark Application 和 Spark Session区别 Spark ...
- 用python, PIL在图像上添加文字(可以控制,调节为水印等)
最近想在图像上,添加想要的文字,首先想到的是matplotlib,但是这个更加倾向于画图(柱状图,折线图之类) opencv这个库肯定也行,但是为了和我现有程序连接在一起,我选择了PIL 其中字体的设 ...
- numpy基本函数
在学习python的时候常常需要numpy这个库,每次都是用一个查一个,这个,终于见到一个完整的总结了http://blog.csdn.net/blog_empire/article/details/ ...
- 两个table合并
1.两个一样的table合并用Merge函数即可合并(但要求table要有主键id) DataTable1.Merge(DataTable2); 2.没写完,以后继续补充(只有经过笔者验证,能用的才会 ...
- ES相关信息
漫画版原理介绍 搜索引擎的核心:倒排索引 elasticsearch 基于Lucene的,封装成一个restful的api,通过api就可进行操作(Lucene是一个apache开放源代码的全文检索引 ...
- U Must Know The .Net --7
关键字 1 new 创建对象/调用构造函数 隐藏基类成员 new()约束,表明泛型类声明中的任何参数都必须有公共无参构造函数 new 实现多态 1.1 new class:分配内存,调用构造函数实例化 ...
- Vim: 强大的g
来源于:http://vim.wikia.com/wiki/Power_of_g 一般格式: :[range]g/pattern/cmd 对range内所有符合pattern的行执行cmd 常见的一些 ...