SlideShare a Scribd company logo
Highly Concurrent
Programming
Nick Brandaleone
	 Lecture 1
Concurrent programming1
The End of Moore’s Law
The End of Moore’s Law
Why we don’t have 10 GHz chips today

Chips are too big

Signals can no longer reach the whole chip in a
clock cycle

Problems with heat dissipation
The Multicore Era
Manufactures have turned towards multi-core
processors in order to increase speed

They are capable of doing multiple calculations in
parallel

CPU speeds are likely to stay relatively flat
Concurrent programming1
The Concurrency
Revolution
Intel HyperThreading - hardware supported

Future computer architectures will have greater
number of cores, from the desktop (12 typical for
workstation) to the smartphone (2 in iPhone)

You will need to develop well-written concurrent
applications to gain from this hardware
development
Vocabulary
Parallelism

Programming as the simultaneous execution of
(possibly related) computations

Concurrency

Programming as the composition of
independently executing processes
Concurrent programming1
Concurrent programming1
Concurrent programming1
Shared State
Concurrency
Threads concurrently execute code

Contains resources that must be shared

Synchronization is required via locks

Data consistency

Visibility

Correct ordering
Concurrent programming1
Why locking is evil
“non-trivial multi-threaded programs are
incomprehensible to human …” - Edward A. Lee,
The Problem with Threads

“humans are quickly overwhelmed by concurrency
and find it much more difficult to reason about
concurrent than sequential code” - Sutter and
Larus

“I have a firm belief that locking primitives are evil”
Concurrent programming1
Message Passing
Carl Hewitt, Richard Steiger and Peter Bishop
released a paper in 1973 introducing the Actor
Model concept

C.A.R. Hoare: Communicating Sequential
Processes (CSP). Introduced in 1978.

Very similar concepts. We shall refer to them both
as “message passing” (aka process calculus)
Concurrent programming1
Concurrent programming1
Concurrent programming1
Alternative Models
Language Method
Erlang Actors
Go
Concurrent Sequential
Processing
Clojure Software Transactional Memory
Icon Coexpressions
Key Concepts
Actors (or go routines) instead of objects

No shared state between actors

Asynchronous message-passing

Share memory by communicating
Amdahl’s Law
Goals for this course:
Learn Concurrent Programming using CSP/Actor model
Become familiar with concurrent programming idioms
All assignments can be fulfilled using Language of choice
•Elixir (Erlang)
•Go (the new “C”)
•Scala (Java)
•Haskell (purely functional)
Grade
•Weekly HW
•Mid-term quiz
•Final Project
The Languages
Erlang
A functional,
dynamically typed
language

Invented at Ericsson in
1986

Designed for
concurrency, scalability
and reliability
Erlang in the real world
Ericsson ATM switch (301 model)

99.9999999 percent uptime

Facebook chat

100s of millions concurrent users

RabbitMQ

High performance AMQP

Apache CouchDB

distributed, fault-tolerant document DB
Concurrent programming1
Concurrent programming1
Syntactic Sugar for Erlang
Elixir example
Go Language
Developed by Rob Pike, formerly of Bell Labs

Statically compiled and typed language, loosely
based upon C syntax

Supports Garbage Collection, and Concurrency

Used internally at Google

Strong community support and documentation
Go example
Scala
The new “Java”. Runs on Java VM

Object oriented and functional design

Very flexible

Can use Java libraries

Syntax can be tough due to mix of OO and F
Scala example
Haskell
Purely functional programming language

Built-in support for concurrency and parallelism

Typically used more in research community than
commercially

Powerful but confusing syntax
Haskell example
FUNCTIONAL VS IMPERATIVE OR OO
PROGRAMMING STYLES
Homework
Research language that you would like to use

Watch http://blog.golang.org/concurrency-is-not-
parallelism video by Rob Pike

Work on Assignment #1 for next week

More Related Content

Viewers also liked (9)

PPTX
Wearable Medical Records Talk at Wearables Tech Conference
Daniel Kivatinos
 
PDF
Concurrency With Go
John-Alan Simmons
 
PDF
An introduction to programming in Go
David Robert Camargo de Campos
 
PDF
Clojuratica - Mathematica and Clojure
Nick Brandaleone
 
PPTX
Gpu workshop cluster universe: scripting cuda
Ferdinand Jamitzky
 
PDF
Concurrency patterns
Aaron Schlesinger
 
PDF
Go Concurrency
jgrahamc
 
PPTX
High performance computing
Guy Tel-Zur
 
PDF
End of Moore's Law?
Jeffrey Funk
 
Wearable Medical Records Talk at Wearables Tech Conference
Daniel Kivatinos
 
Concurrency With Go
John-Alan Simmons
 
An introduction to programming in Go
David Robert Camargo de Campos
 
Clojuratica - Mathematica and Clojure
Nick Brandaleone
 
Gpu workshop cluster universe: scripting cuda
Ferdinand Jamitzky
 
Concurrency patterns
Aaron Schlesinger
 
Go Concurrency
jgrahamc
 
High performance computing
Guy Tel-Zur
 
End of Moore's Law?
Jeffrey Funk
 

Similar to Concurrent programming1 (20)

PPTX
Seminar on Parallel and Concurrent Programming
Stefan Marr
 
PDF
Actor Model and C++: what, why and how? (March 2020 Edition)
Yauheni Akhotnikau
 
PPTX
Ruby Concurrency
Egor Hamaliy
 
PPTX
Interactions complicate debugging
Syed Zaid Irshad
 
PDF
Our Concurrent Past; Our Distributed Future
C4Media
 
PDF
Actor Model and C++: what, why and how?
Yauheni Akhotnikau
 
PDF
Concurrency for dummies
Azrul MADISA
 
PDF
Are High Level Programming Languages for Multicore and Safety Critical Conver...
InfinIT - Innovationsnetværket for it
 
PDF
Learning Concurrent Programming in Scala Second Edition Aleksandar Prokopec
trtekatsuro
 
PPT
cs2110Concurrency1.ppt
narendra551069
 
PDF
Mike Bartley - Innovations for Testing Parallel Software - EuroSTAR 2012
TEST Huddle
 
PPT
Multithreading in java programming language.ppt
AutoAuto9
 
PDF
The Concurrency Challenge : Notes
Subhajit Sahu
 
PDF
Concurrency
Sri Prasanna
 
PDF
Reactive Software Systems
Behrad Zari
 
PDF
Sharing-akka-pub
Hendri Karisma
 
DOCX
Paper Analysis Essay The 5-page Paper You Submit Must At L.docx
aman341480
 
DOCX
Paper Analysis Essay The 5-page Paper You Submit Must At L.docx
mosyrettcc
 
PDF
Concurrent Programming On Windows Joe Duffy
weihaoborder56
 
PDF
Highly concurrent yet natural programming
Infinit
 
Seminar on Parallel and Concurrent Programming
Stefan Marr
 
Actor Model and C++: what, why and how? (March 2020 Edition)
Yauheni Akhotnikau
 
Ruby Concurrency
Egor Hamaliy
 
Interactions complicate debugging
Syed Zaid Irshad
 
Our Concurrent Past; Our Distributed Future
C4Media
 
Actor Model and C++: what, why and how?
Yauheni Akhotnikau
 
Concurrency for dummies
Azrul MADISA
 
Are High Level Programming Languages for Multicore and Safety Critical Conver...
InfinIT - Innovationsnetværket for it
 
Learning Concurrent Programming in Scala Second Edition Aleksandar Prokopec
trtekatsuro
 
cs2110Concurrency1.ppt
narendra551069
 
Mike Bartley - Innovations for Testing Parallel Software - EuroSTAR 2012
TEST Huddle
 
Multithreading in java programming language.ppt
AutoAuto9
 
The Concurrency Challenge : Notes
Subhajit Sahu
 
Concurrency
Sri Prasanna
 
Reactive Software Systems
Behrad Zari
 
Sharing-akka-pub
Hendri Karisma
 
Paper Analysis Essay The 5-page Paper You Submit Must At L.docx
aman341480
 
Paper Analysis Essay The 5-page Paper You Submit Must At L.docx
mosyrettcc
 
Concurrent Programming On Windows Joe Duffy
weihaoborder56
 
Highly concurrent yet natural programming
Infinit
 
Ad

Recently uploaded (20)

PPTX
An Introduction to ZAP by Checkmarx - Official Version
Simon Bennetts
 
PDF
유니티에서 Burst Compiler+ThreadedJobs+SIMD 적용사례
Seongdae Kim
 
PDF
iTop VPN With Crack Lifetime Activation Key-CODE
utfefguu
 
PDF
Digger Solo: Semantic search and maps for your local files
seanpedersen96
 
PDF
Efficient, Automated Claims Processing Software for Insurers
Insurance Tech Services
 
PDF
Streamline Contractor Lifecycle- TECH EHS Solution
TECH EHS Solution
 
PDF
Build It, Buy It, or Already Got It? Make Smarter Martech Decisions
bbedford2
 
PDF
MiniTool Partition Wizard 12.8 Crack License Key LATEST
hashhshs786
 
PPTX
Revolutionizing Code Modernization with AI
KrzysztofKkol1
 
PPTX
Equipment Management Software BIS Safety UK.pptx
BIS Safety Software
 
PDF
Revenue streams of the Wazirx clone script.pdf
aaronjeffray
 
PPTX
Human Resources Information System (HRIS)
Amity University, Patna
 
PPTX
MailsDaddy Outlook OST to PST converter.pptx
abhishekdutt366
 
PPTX
Engineering the Java Web Application (MVC)
abhishekoza1981
 
PDF
Unlock Efficiency with Insurance Policy Administration Systems
Insurance Tech Services
 
PDF
Capcut Pro Crack For PC Latest Version {Fully Unlocked} 2025
hashhshs786
 
PPTX
A Complete Guide to Salesforce SMS Integrations Build Scalable Messaging With...
360 SMS APP
 
PDF
Beyond Binaries: Understanding Diversity and Allyship in a Global Workplace -...
Imma Valls Bernaus
 
PDF
Understanding the Need for Systemic Change in Open Source Through Intersectio...
Imma Valls Bernaus
 
PDF
Alarm in Android-Scheduling Timed Tasks Using AlarmManager in Android.pdf
Nabin Dhakal
 
An Introduction to ZAP by Checkmarx - Official Version
Simon Bennetts
 
유니티에서 Burst Compiler+ThreadedJobs+SIMD 적용사례
Seongdae Kim
 
iTop VPN With Crack Lifetime Activation Key-CODE
utfefguu
 
Digger Solo: Semantic search and maps for your local files
seanpedersen96
 
Efficient, Automated Claims Processing Software for Insurers
Insurance Tech Services
 
Streamline Contractor Lifecycle- TECH EHS Solution
TECH EHS Solution
 
Build It, Buy It, or Already Got It? Make Smarter Martech Decisions
bbedford2
 
MiniTool Partition Wizard 12.8 Crack License Key LATEST
hashhshs786
 
Revolutionizing Code Modernization with AI
KrzysztofKkol1
 
Equipment Management Software BIS Safety UK.pptx
BIS Safety Software
 
Revenue streams of the Wazirx clone script.pdf
aaronjeffray
 
Human Resources Information System (HRIS)
Amity University, Patna
 
MailsDaddy Outlook OST to PST converter.pptx
abhishekdutt366
 
Engineering the Java Web Application (MVC)
abhishekoza1981
 
Unlock Efficiency with Insurance Policy Administration Systems
Insurance Tech Services
 
Capcut Pro Crack For PC Latest Version {Fully Unlocked} 2025
hashhshs786
 
A Complete Guide to Salesforce SMS Integrations Build Scalable Messaging With...
360 SMS APP
 
Beyond Binaries: Understanding Diversity and Allyship in a Global Workplace -...
Imma Valls Bernaus
 
Understanding the Need for Systemic Change in Open Source Through Intersectio...
Imma Valls Bernaus
 
Alarm in Android-Scheduling Timed Tasks Using AlarmManager in Android.pdf
Nabin Dhakal
 
Ad

Concurrent programming1

  • 3. The End of Moore’s Law
  • 4. The End of Moore’s Law Why we don’t have 10 GHz chips today Chips are too big Signals can no longer reach the whole chip in a clock cycle Problems with heat dissipation
  • 5. The Multicore Era Manufactures have turned towards multi-core processors in order to increase speed They are capable of doing multiple calculations in parallel CPU speeds are likely to stay relatively flat
  • 7. The Concurrency Revolution Intel HyperThreading - hardware supported Future computer architectures will have greater number of cores, from the desktop (12 typical for workstation) to the smartphone (2 in iPhone) You will need to develop well-written concurrent applications to gain from this hardware development
  • 8. Vocabulary Parallelism Programming as the simultaneous execution of (possibly related) computations Concurrency Programming as the composition of independently executing processes
  • 12. Shared State Concurrency Threads concurrently execute code Contains resources that must be shared Synchronization is required via locks Data consistency Visibility Correct ordering
  • 14. Why locking is evil “non-trivial multi-threaded programs are incomprehensible to human …” - Edward A. Lee, The Problem with Threads “humans are quickly overwhelmed by concurrency and find it much more difficult to reason about concurrent than sequential code” - Sutter and Larus “I have a firm belief that locking primitives are evil”
  • 16. Message Passing Carl Hewitt, Richard Steiger and Peter Bishop released a paper in 1973 introducing the Actor Model concept C.A.R. Hoare: Communicating Sequential Processes (CSP). Introduced in 1978. Very similar concepts. We shall refer to them both as “message passing” (aka process calculus)
  • 20. Alternative Models Language Method Erlang Actors Go Concurrent Sequential Processing Clojure Software Transactional Memory Icon Coexpressions
  • 21. Key Concepts Actors (or go routines) instead of objects No shared state between actors Asynchronous message-passing Share memory by communicating
  • 23. Goals for this course: Learn Concurrent Programming using CSP/Actor model Become familiar with concurrent programming idioms All assignments can be fulfilled using Language of choice •Elixir (Erlang) •Go (the new “C”) •Scala (Java) •Haskell (purely functional) Grade •Weekly HW •Mid-term quiz •Final Project
  • 25. Erlang A functional, dynamically typed language Invented at Ericsson in 1986 Designed for concurrency, scalability and reliability
  • 26. Erlang in the real world Ericsson ATM switch (301 model) 99.9999999 percent uptime Facebook chat 100s of millions concurrent users RabbitMQ High performance AMQP Apache CouchDB distributed, fault-tolerant document DB
  • 31. Go Language Developed by Rob Pike, formerly of Bell Labs Statically compiled and typed language, loosely based upon C syntax Supports Garbage Collection, and Concurrency Used internally at Google Strong community support and documentation
  • 33. Scala The new “Java”. Runs on Java VM Object oriented and functional design Very flexible Can use Java libraries Syntax can be tough due to mix of OO and F
  • 35. Haskell Purely functional programming language Built-in support for concurrency and parallelism Typically used more in research community than commercially Powerful but confusing syntax
  • 37. FUNCTIONAL VS IMPERATIVE OR OO PROGRAMMING STYLES
  • 38. Homework Research language that you would like to use Watch http://blog.golang.org/concurrency-is-not- parallelism video by Rob Pike Work on Assignment #1 for next week