北京大学:《大规模数据处理——云计算 Mass Data Processing Cloud Computing》课程教学资源(PPT课件)并行与分布式系统基础 Introduction to Distributed Systems

NC&IS Introduction to Distributed System Parallelization Synchronization
Introduction to Distributed System Parallelization & Synchronization

Parallelization Idea (2) w1 w2 w3 Spawn worker threads: thread thread thread
Parallelization Idea (2) w1 w2 w3 thread thread thread Spawn worker threads:

Parallelization Idea (3) Workers process data: thread thread thread w1 w2 w3
Parallelization Idea (3) thread thread thread Workers process data: w1 w2 w3

Parallelization Idea (4) thread thread thread w1 w2 w3 Report results results
Parallelization Idea (4) results Report results thread thread thread w1 w2 w3

Process synchronization refers to the coordination of simultaneous threads or processes to complete a task in order to get correct runtime order and avoid unexpected race conditions
Process synchronization refers to the coordination of simultaneous threads or processes to complete a task in order to get correct runtime order and avoid unexpected race conditions

M然
And if you thought I was joking…

What is Wrong With This? Thread 1: Thread 2: void foo(){ void bar(){ X++ y++; y=X; X++ } If the initial state is y =0,x=6,what happens after these threads finish running?
What is Wrong With This? Thread 1: void foo() { x++; y = x; } Thread 2: void bar() { y++; x++; } If the initial state is y = 0, x = 6, what happens after these threads finish running?

Multithreaded Unpredictability Many things that look like "one step"operations actually take several steps under the hood: Thread 1: Thread 2: void foo(){ void bar() eax mem[x]; eax mem[y]; inc eax; inc eax; mem[x]eax; mem[y]eax; ebx mem[x]; eax mem[x]; mem[y]ebx; inc eax; mem[x]eax; When we run a multithreaded program,we don't know what order threads run in,nor do we know when they will interrupt one another
Multithreaded = Unpredictability ◼ When we run a multithreaded program, we don’t know what order threads run in, nor do we know when they will interrupt one another. Thread 1: void foo() { eax = mem[x]; inc eax; mem[x] = eax; ebx = mem[x]; mem[y] = ebx; } Thread 2: void bar() { eax = mem[y]; inc eax; mem[y] = eax; eax = mem[x]; inc eax; mem[x] = eax; } ◼ Many things that look like “one step” operations actually take several steps under the hood:

Multithreaded Unpredictability This applies to more than just integers: Pulling work units from a queue Reporting work back to master unit Telling another thread that it can begin the "next phase”of processing ..All require synchronization!
Multithreaded = Unpredictability This applies to more than just integers: ◼ Pulling work units from a queue ◼ Reporting work back to master unit ◼ Telling another thread that it can begin the “next phase” of processing … All require synchronization!

Synchronization Primitives Lock Semaphore Barriers Thread 1: Thread 2: void foo(){ void bar( sem.lock(); sem.lock(; X++; y++; y=X X++ sem.unlockO; sem.unlockO;
Synchronization Primitives Semaphore Barriers Lock Thread 1: void foo() { sem.lock(); x++; y = x; sem.unlock(); } Thread 2: void bar() { sem.lock(); y++; x++; sem.unlock(); }
按次数下载不扣除下载券;
注册用户24小时内重复下载只扣除一次;
顺序:VIP每日次数-->可用次数-->下载券;
- 北京大学:《大规模数据处理——云计算 Mass Data Processing Cloud Computing》课程教学资源(PPT课件)Clustering问题 Clustering.ppt
- 北京大学:《大规模数据处理——云计算 Mass Data Processing Cloud Computing》课程教学资源(PPT课件)MapReduce系统设计与实现 Web Search on MapReduce.ppt
- 北京大学:《大规模数据处理——云计算 Mass Data Processing Cloud Computing》课程教学资源(PPT课件)MapReduce算法设计 Basic MapReduce Algorithm Design.ppt
- 北京大学:《大规模数据处理——云计算 Mass Data Processing Cloud Computing》课程教学资源(PPT课件)MapReduce原理 MapReduce Theory and Practice.ppt
- 北京大学:《大规模数据处理——云计算 Mass Data Processing Cloud Computing》课程教学资源(PPT课件)课程介绍 Introduction to Cloud Computing(主讲:彭波).ppt
- 《大规模数据处理——云计算 Mass Data Processing Cloud Computing》课程教学资源(阅读材料)Data-Intensive Text Processing(MapReduce book 20100307).pdf
- 《大规模数据处理——云计算 Mass Data Processing Cloud Computing》课程教学资源(阅读材料)MapReduce——Simplified Data Processing on Large Clusters.pdf
- 《大规模数据处理——云计算 Mass Data Processing Cloud Computing》课程教学资源(阅读材料)The Google File System(GFS).pdf
- 《大规模数据处理——云计算 Mass Data Processing Cloud Computing》课程教学资源(阅读材料)k-means++——The Advantages of Careful Seeding.pdf
- 《大规模数据处理——云计算 Mass Data Processing Cloud Computing》课程教学资源(阅读材料)Efficient Clustering of High-Dimensional Data Sets with Application to Reference Matching.pdf
- 《大规模数据处理——云计算 Mass Data Processing Cloud Computing》课程教学资源(阅读材料)The Anatomy of a Large-Scale Hypertextual Web Search Engine.pdf
- 上海中医药大学:课程教学大纲汇编合集——教学大纲(计算机中心、图书信息中心).pdf
- 北京中医药大学:《计算机基础》课程教学资源(PPT课件)第8章 模块.ppt
- 北京中医药大学:《计算机基础》课程PPT教学课件(Access 数据库程序设计)包装应用系统.ppt
- 北京中医药大学:《计算机基础》课程教学资源(PPT课件)第7章 宏.ppt
- 北京中医药大学:《计算机基础》课程教学资源(PPT课件)第5章 报表.ppt
- 北京中医药大学:《计算机基础》课程教学资源(教学大纲,Ⅱ).doc
- 北京中医药大学:《计算机基础》课程教学资源(电子教材)《Access 数据库程序设计》第5章 报表.doc
- 北京中医药大学:《计算机基础》课程教学资源(电子教材)《Access 数据库程序设计》第4章 窗体.doc
- 北京中医药大学:《计算机基础》课程教学资源(试卷习题)2009年9月全国计算机等级考试二级笔试试卷——Access 数据库程序设计(含答案).docx
- 北京大学:《大规模数据处理——云计算 Mass Data Processing Cloud Computing》课程教学资源(PPT课件)分布式文件系统 Distributed File systems.ppt
- 北京大学:《移动计算与无线网络》课程教学资源(学生PPT)课程实验——WLAN性能实证(802.11 Wlan无线通讯实验).ppt
- 北京大学:《移动计算与无线网络》课程教学资源(学生PPT)揭秘WLAN无线链路的丢包规律.ppt
- 北京大学:《移动计算与无线网络》课程教学资源(学生PPT)无线实验——距离障碍物等因素之影响.ppt
- 西安电子科技大学:《信息系统安全》课程教学资源(PPT课件讲稿)第一章 绪论(主讲教师:董庆宽).ppt
- 西安电子科技大学:《现代密码学》课程教学资源(PPT课件讲稿)第三章 分组密码.pptx
- 西安电子科技大学:《现代密码学》课程教学资源(PPT课件讲稿)第五章 消息认证算法.pptx
- 郑州大学:《计算机网络》课程电子教案(课件讲稿)第1章 概述.pdf
- 郑州大学:《计算机网络》课程电子教案(课件讲稿)第2章 物理层.pdf
- 郑州大学:《计算机网络》课程电子教案(课件讲稿)第3章 数据链路层.pdf
- 郑州大学:《计算机网络》课程电子教案(课件讲稿)第4章 网络层.pdf
- 郑州大学:《计算机网络》课程电子教案(课件讲稿)第5章 运输层.pdf
- 郑州大学:《计算机网络》课程电子教案(课件讲稿)第6章 应用层.pdf
- 唐山广播电视大学:Premiere Pro CC视频编辑——期末复习题及答案.doc
- 四川开放大学:《跨境电商》课程教学资源(试卷习题)期末考试试题一(试题).doc
- 四川开放大学:《跨境电商》课程教学资源(试卷习题)期末考试试题一(答案).doc
- 四川开放大学:《跨境电商》课程教学资源(试卷习题)期末考试试题三(试题).doc
- 四川开放大学:《跨境电商》课程教学资源(试卷习题)期末考试试题三(答案).doc
- 四川开放大学:《跨境电商》课程教学资源(试卷习题)期末考试试题二(试题).doc
- 四川开放大学:《跨境电商》课程教学资源(试卷习题)期末考试试题二(答案).doc