SlideShare a Scribd company logo
1 of 37
Distributed Computing Seminar Lecture 1: Introduction to Distributed  Computing & Systems Background Christophe Bisciglia, Aaron Kimball, & Sierra Michels-Slettvet Summer 2007 Except where otherwise noted, the contents of this presentation are © Copyright 2007 University of Washington and are licensed under the Creative Commons Attribution 2.5 License.
Course Overview ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Outline ,[object Object],[object Object],[object Object],[object Object],[object Object]
Computer Speedup Moore’s Law: “ The density of transistors on a chip doubles every 18 months, for the same cost”  (1965) Image: Tom’s Hardware and not subject to the Creative Commons license applicable to the rest of this work.  Image: Tom’s Hardware
Scope of problems ,[object Object],[object Object],[object Object]
Distributed problems ,[object Object],Image: DreamWorks Animation and not subject to the Creative Commons license applicable to the rest of this work.
Distributed problems ,[object Object],Happy Feet  © Kingdom Feature Productions; Lord of the Rings  © New Line Cinema, neither image is subject to the Creative Commons license applicable to the rest of the work.
Distributed problems ,[object Object],[object Object],[object Object],What is the key attribute that all these examples have in common?
Parallel vs. Distributed ,[object Object],[object Object],[object Object],[object Object]
A Brief History… 1975-85 ,[object Object],[object Object],[object Object],Image:  Computer Pictures Database and Cray Research Corp and is not subject to the Creative Commons license applicable to the rest of this work.
[object Object],[object Object],[object Object],A Brief History… 1985-95
A Brief History… 1995-Today ,[object Object],[object Object],[object Object],[object Object]
Parallelization & Synchronization
Parallelization Idea ,[object Object]
Parallelization Idea (2) In a parallel computation, we would like to have as many threads as we have processors. e.g., a four-processor computer would be able to run four threads at the same time.
Parallelization Idea (3)
Parallelization Idea (4)
Parallelization Pitfalls ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],What is the common theme of all of these problems?
Parallelization Pitfalls (2) ,[object Object],[object Object]
What is Wrong With This? ,[object Object],[object Object],[object Object],[object Object],[object Object],Thread 2: void bar() { y++; x+=3; } If the initial state is y = 0, x = 6, what happens after these threads finish running?
Multithreaded = Unpredictability ,[object Object],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]; add eax, 3; mem[x] = eax; } ,[object Object]
Multithreaded = Unpredictability ,[object Object],[object Object],[object Object],[object Object],[object Object]
Synchronization Primitives ,[object Object],[object Object]
Semaphores ,[object Object],[object Object],Only one side of the semaphore can ever be red! (Can both be green?)
Semaphores ,[object Object],[object Object],[object Object]
The “corrected” example Thread 1: void foo() { sem.lock(); x++; y = x; sem.unlock(); } Thread 2: void bar() { sem.lock(); y++; x+=3; sem.unlock(); } Global var “Semaphore sem = new Semaphore();” guards access to x & y
Condition Variables ,[object Object],[object Object],[object Object]
The final example Thread 1: void foo() { sem.lock(); x++; y = x; fooDone = true; sem.unlock(); fooFinishedCV.notify(); } Thread 2: void bar() { sem.lock(); if(!fooDone) fooFinishedCV.wait(sem); y++; x+=3; sem.unlock(); } Global vars: Semaphore sem = new Semaphore(); ConditionVar fooFinishedCV = new ConditionVar(); boolean fooDone = false;
Too Much Synchronization? Deadlock Synchronization becomes even more complicated when multiple locks can be used Can cause entire system to “get stuck” Thread A: semaphore1.lock(); semaphore2.lock(); /* use data guarded by  semaphores */ semaphore1.unlock();  semaphore2.unlock(); Thread B: semaphore2.lock(); semaphore1.lock(); /* use data guarded by  semaphores */ semaphore1.unlock();  semaphore2.unlock(); (Image: RPI CSCI.4210 Operating Systems notes)
The Moral: Be Careful! ,[object Object],[object Object],[object Object],[object Object],[object Object]
Fundamentals of Networking
Sockets: The Internet = tubes? ,[object Object],[object Object],[object Object]
Ports ,[object Object],[object Object]
What makes this work? ,[object Object],[object Object],Even more low-level protocols handle how data is sent over Ethernet wires, or how bits are sent through the air using 802.11 wireless…
Why is This Necessary? ,[object Object],[object Object]
Networking Issues ,[object Object],[object Object],[object Object],[object Object]
Conclusions ,[object Object],[object Object],[object Object],[object Object]

More Related Content

Viewers also liked

Parallel Programming Primer 1
Parallel Programming Primer 1Parallel Programming Primer 1
Parallel Programming Primer 1mobius.cn
 
Lec4 Clustering
Lec4 ClusteringLec4 Clustering
Lec4 Clusteringmobius.cn
 
Lecture 1 (distributed systems)
Lecture 1 (distributed systems)Lecture 1 (distributed systems)
Lecture 1 (distributed systems)Fazli Amin
 
Lec5 Pagerank
Lec5 PagerankLec5 Pagerank
Lec5 Pagerankmobius.cn
 

Viewers also liked (6)

Parallel Programming Primer 1
Parallel Programming Primer 1Parallel Programming Primer 1
Parallel Programming Primer 1
 
Lec3 Dfs
Lec3 DfsLec3 Dfs
Lec3 Dfs
 
Lec2 Mapred
Lec2 MapredLec2 Mapred
Lec2 Mapred
 
Lec4 Clustering
Lec4 ClusteringLec4 Clustering
Lec4 Clustering
 
Lecture 1 (distributed systems)
Lecture 1 (distributed systems)Lecture 1 (distributed systems)
Lecture 1 (distributed systems)
 
Lec5 Pagerank
Lec5 PagerankLec5 Pagerank
Lec5 Pagerank
 

Similar to Lec1 Intro

Introduction to Cluster Computing and Map Reduce (from Google)
Introduction to Cluster Computing and Map Reduce  (from Google)Introduction to Cluster Computing and Map Reduce  (from Google)
Introduction to Cluster Computing and Map Reduce (from Google)Sri Prasanna
 
Introduction & Parellelization on large scale clusters
Introduction & Parellelization on large scale clustersIntroduction & Parellelization on large scale clusters
Introduction & Parellelization on large scale clustersSri Prasanna
 
Distributed computing presentation
Distributed computing presentationDistributed computing presentation
Distributed computing presentationDelhi/NCR HUG
 
Multithreading 101
Multithreading 101Multithreading 101
Multithreading 101Tim Penhey
 
Software and the Concurrency Revolution : Notes
Software and the Concurrency Revolution : NotesSoftware and the Concurrency Revolution : Notes
Software and the Concurrency Revolution : NotesSubhajit Sahu
 
Introto netthreads-090906214344-phpapp01
Introto netthreads-090906214344-phpapp01Introto netthreads-090906214344-phpapp01
Introto netthreads-090906214344-phpapp01Aravindharamanan S
 
Operating System 4 1193308760782240 2
Operating System 4 1193308760782240 2Operating System 4 1193308760782240 2
Operating System 4 1193308760782240 2mona_hakmy
 
Operating System 4
Operating System 4Operating System 4
Operating System 4tech2click
 
Computer Network Theory Part 4
Computer Network Theory Part 4Computer Network Theory Part 4
Computer Network Theory Part 4NishatTasnimAli
 
Processes, Threads and Scheduler
Processes, Threads and SchedulerProcesses, Threads and Scheduler
Processes, Threads and SchedulerMunazza-Mah-Jabeen
 
Networking threads
Networking threadsNetworking threads
Networking threadsNilesh Pawar
 
1 osi model
1 osi model1 osi model
1 osi modelSpacSec
 
Osi , tcp/ip protocol and Addressing
Osi , tcp/ip protocol and Addressing Osi , tcp/ip protocol and Addressing
Osi , tcp/ip protocol and Addressing marwan aldulaimy
 
Significance
SignificanceSignificance
SignificanceJulie May
 
Networking Basics
Networking BasicsNetworking Basics
Networking BasicsCarlo Fonda
 

Similar to Lec1 Intro (20)

Introduction to Cluster Computing and Map Reduce (from Google)
Introduction to Cluster Computing and Map Reduce  (from Google)Introduction to Cluster Computing and Map Reduce  (from Google)
Introduction to Cluster Computing and Map Reduce (from Google)
 
Introduction & Parellelization on large scale clusters
Introduction & Parellelization on large scale clustersIntroduction & Parellelization on large scale clusters
Introduction & Parellelization on large scale clusters
 
Distributed computing presentation
Distributed computing presentationDistributed computing presentation
Distributed computing presentation
 
Multithreading 101
Multithreading 101Multithreading 101
Multithreading 101
 
CN QNAs.pdf
CN QNAs.pdfCN QNAs.pdf
CN QNAs.pdf
 
Software and the Concurrency Revolution : Notes
Software and the Concurrency Revolution : NotesSoftware and the Concurrency Revolution : Notes
Software and the Concurrency Revolution : Notes
 
Again music
Again musicAgain music
Again music
 
Introto netthreads-090906214344-phpapp01
Introto netthreads-090906214344-phpapp01Introto netthreads-090906214344-phpapp01
Introto netthreads-090906214344-phpapp01
 
Operating System 4 1193308760782240 2
Operating System 4 1193308760782240 2Operating System 4 1193308760782240 2
Operating System 4 1193308760782240 2
 
Operating System 4
Operating System 4Operating System 4
Operating System 4
 
Computer Network Theory Part 4
Computer Network Theory Part 4Computer Network Theory Part 4
Computer Network Theory Part 4
 
Processes, Threads and Scheduler
Processes, Threads and SchedulerProcesses, Threads and Scheduler
Processes, Threads and Scheduler
 
CH04.pdf
CH04.pdfCH04.pdf
CH04.pdf
 
Osi model
Osi modelOsi model
Osi model
 
Networking threads
Networking threadsNetworking threads
Networking threads
 
1 osi model
1 osi model1 osi model
1 osi model
 
Osi , tcp/ip protocol and Addressing
Osi , tcp/ip protocol and Addressing Osi , tcp/ip protocol and Addressing
Osi , tcp/ip protocol and Addressing
 
Introducing Parallel Pixie Dust
Introducing Parallel Pixie DustIntroducing Parallel Pixie Dust
Introducing Parallel Pixie Dust
 
Significance
SignificanceSignificance
Significance
 
Networking Basics
Networking BasicsNetworking Basics
Networking Basics
 

Lec1 Intro

  • 1. Distributed Computing Seminar Lecture 1: Introduction to Distributed Computing & Systems Background Christophe Bisciglia, Aaron Kimball, & Sierra Michels-Slettvet Summer 2007 Except where otherwise noted, the contents of this presentation are © Copyright 2007 University of Washington and are licensed under the Creative Commons Attribution 2.5 License.
  • 2.
  • 3.
  • 4. Computer Speedup Moore’s Law: “ The density of transistors on a chip doubles every 18 months, for the same cost” (1965) Image: Tom’s Hardware and not subject to the Creative Commons license applicable to the rest of this work. Image: Tom’s Hardware
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 14.
  • 15. Parallelization Idea (2) In a parallel computation, we would like to have as many threads as we have processors. e.g., a four-processor computer would be able to run four threads at the same time.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26. The “corrected” example Thread 1: void foo() { sem.lock(); x++; y = x; sem.unlock(); } Thread 2: void bar() { sem.lock(); y++; x+=3; sem.unlock(); } Global var “Semaphore sem = new Semaphore();” guards access to x & y
  • 27.
  • 28. The final example Thread 1: void foo() { sem.lock(); x++; y = x; fooDone = true; sem.unlock(); fooFinishedCV.notify(); } Thread 2: void bar() { sem.lock(); if(!fooDone) fooFinishedCV.wait(sem); y++; x+=3; sem.unlock(); } Global vars: Semaphore sem = new Semaphore(); ConditionVar fooFinishedCV = new ConditionVar(); boolean fooDone = false;
  • 29. Too Much Synchronization? Deadlock Synchronization becomes even more complicated when multiple locks can be used Can cause entire system to “get stuck” Thread A: semaphore1.lock(); semaphore2.lock(); /* use data guarded by semaphores */ semaphore1.unlock(); semaphore2.unlock(); Thread B: semaphore2.lock(); semaphore1.lock(); /* use data guarded by semaphores */ semaphore1.unlock(); semaphore2.unlock(); (Image: RPI CSCI.4210 Operating Systems notes)
  • 30.
  • 32.
  • 33.
  • 34.
  • 35.
  • 36.
  • 37.

Editor's Notes

  1. There are multiple possible final states. Y is definitely a problem, because we don’t know if it will be “1” or “7”… but X can also be 7, 10, or 11!
  2. Inform students that the term we want here is “race condition”
  3. Ask: are there still any problems? (Yes – we still have two possible outcomes. We want some other system that allows us to serialize access on an event.)
  4. Go over wait() / notify() / broadcast() --- must be combined with a semaphore!