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更适合编写网络服 ...
随机推荐
- CSS3:CSS3 圆角
ylbtech-CSS3:CSS3 圆角 1.返回顶部 1. CSS3 圆角 CSS3 圆角 使用 CSS3 border-radius 属性,你可以给任何元素制作 "圆角". C ...
- 创建 Angular 8.0 项目
创建 Angular 8.0 项目,首先确保已经安装了 nodejs,如果没有安装,请看这篇文章安装:node.js 安装 1.新建一个空文件夹 angularproject,作为工作区 2.安装 A ...
- jquery中typeof的用法
typeof 可以用来检测给定变量的数据类型,可能的返回值: 'undefined' 'boolean' 'string' 'number' 'object' 'function' var hahah ...
- Quartz2作业监听
在本教程中,我们将展示/介绍如何创建一个JobListener,跟踪运行工作状态在作业完成等. P.S 这个例子是Quartz 2.1.5 1. Quartz 作业 作业 - 用于打印一个简单的信息, ...
- redhat7和redhat6混合搭建文档
1.下载cm对应redhat7的版本.2.修改/opt/cloudera/cm-5.10.0/etc/cloudera-scm-agent/config.ini成为中心机器hostname/ip(ma ...
- MySQL 10章_视图、事务
一. 视图: 视图(view)是保存了查询语句的一种数据库对象,其数据来源是查询语句对应的数据表,他的结果与数据表查询的结果一样也是一张虚拟的数据表 . 为什么需要视图: ) 不同的用户关心的数据可能 ...
- 【JDK】:java.lang.Integer源码解析
本文对JDK8中的java.lang.Integer包装类的部分数值缓存技术.valueOf().stringSize().toString().getChars().parseInt()等进行简要分 ...
- JAVA数据结构之二叉树
用树作为存储数据的结构兼具像数组一样查询速度快和像链表一样具有很快的插入和删除数据项的优点 我们用圆点表示节点,连接圆的直线表示边如下图所示就表示了一颗树,接下来我们讨论的二叉树即每个节点最多只有两个 ...
- Java中的常量池
JVM中有: Class文件常量池.运行时常量池.全局字符串常量池.基本类型包装类对象 常量池 Class文件常量池: class文件是一组以字节为单位的二进制数据流,在java代码的编译期间,编写的 ...
- Java 虚拟机 - 2.3 HotSpot虚拟机对象
对象的创建 Step1 类加载检查 当发现一条new指令时,检查: 该指令的参数是否能在常量池中定位到一个类的符号引用: 并且检查这个符号引用代表的类是否已经被加载.解析和初始化过.如果没有,那必须先 ...