SlideShare a Scribd company logo
1 of 39
Download to read offline
No. 1
Ā© Copyright 2012 Avanade Inc. All Rights Reserved. Confidential For Internal Use Only
No. 2
Ā© Copyright 2012 Avanade Inc. All Rights Reserved. Confidential For Internal Use Only
No. 3
Ā© Copyright 2012 Avanade Inc. All Rights Reserved. Confidential For Internal Use Only
No. 4
Architect Developer Tester
Product
Management
Business
Management
Ā© Copyright 2012 Avanade Inc. All Rights Reserved. Confidential For Internal Use Only
No. 5
Most servers
today both have
multi-core and
multi-processor
architecture
You should not
rely on the OS to
do parallel
programming
Parallel
programming is
just not for Super
Geeks any more
(Driver
developers, OS
developers, C++
guys)
All verticals are
starting to
want/need
parallel
programming
Parallel
programming can
be leveraged well
in some cloud
scenarios
Ā© Copyright 2012 Avanade Inc. All Rights Reserved. Confidential For Internal Use Only
Beijing National Stadium - a.k.a ā€œBirdā€™s Nestā€
Ā© Copyright 2012 Avanade Inc. All Rights Reserved. Confidential For Internal Use Only
Ā© Copyright 2012 Avanade Inc. All Rights Reserved. Confidential For Internal Use Only
Concurrency
ā€¢ GOAL: Prevent thread starvation
ā€¢ concept related to multitasking and asynchronous input-output (I/O)
ā€¢ existence of multiple threads of execution that may each get a slice of
time to execute before being preempted by another thread
Parallelism
ā€¢ GOAL: Maximize processor usage across all available cores
ā€¢ concurrent threads execute at the same time across cores
ā€¢ focuses on improving the performance of applications that use a lot
of processor power and are not constantly interrupted when multiple
cores are available.
Ā© Copyright 2012 Avanade Inc. All Rights Reserved. Confidential For Internal Use Only
No. 9
Ā© Copyright 2012 Avanade Inc. All Rights Reserved. Confidential For Internal Use Only
TPL for .net
MPL Express/JFFP
RiverTrail for Javascript
Ā© Copyright 2012 Avanade Inc. All Rights Reserved. Confidential For Internal Use Only
Decomposition Coordination
Scalable
Sharing
Ā© Copyright 2012 Avanade Inc. All Rights Reserved. Confidential For Internal Use Only
No. 12
ā€¢ Too fine = overhead to manage will become to much
ā€¢ Too course = parallel opportunities will be lost
Identify tasks at a level of granularity that results in
efficient use of hardware resources.
ā€¢ They should remain independent of each other, and have enough tasks to
keep the cores busy
Tasks should be as large as possible
ā€¢ Dedicate some time to understand these components.
Decomposing a problem into tasks requires a good
understanding of the algorithmic and structural aspects
of your application.
Ā© Copyright 2012 Avanade Inc. All Rights Reserved. Confidential For Internal Use Only
Seanā€™s General Rule of thumb:
If iteration takes longer than 1 minute, review further.
Ā© Copyright 2012 Avanade Inc. All Rights Reserved. Confidential For Internal Use Only
No. 14
Coordination depends on
specifically which parallel
patterns you use to
implement
Application algorithms are
constrained by order of
execution and degree of
parallelism
ā€¢ Constraints can come from data
flow or control flow.
The Futures pattern uses
Continuation to manage
coordination.
ā€¢ Make sure that you understand any
coordination, before modifying you
application.
Mapping out dependencies
in a graph or inheritance
tree helps truly understand
the landscape
Ā© Copyright 2012 Avanade Inc. All Rights Reserved. Confidential For Internal Use Only
No. 15
Limit your
shared
variables
Use immutable
data when you
can Introduce new steps in
your algorithm that merge
local versions of mutable
state at checkpoints
Adding synchronization
reduces the parallelism of
your application.
Parallel Loop
Parallel Tasks
Parallel Aggregation
Futures
Pipelines
Ā© Copyright 2012 Avanade Inc. All Rights Reserved. Confidential For Internal Use Only
No. 17
Do you have sequential loops where there's no
communication among the steps of each
iteration?
Use the Parallel Loop pattern
Ā© Copyright 2012 Avanade Inc. All Rights Reserved. Confidential For Internal Use Only
Parallel loops apply an independent operation to
multiple inputs simultaneously.
Very similar to for and foreach.
Sequence in the collection will not matter.
Do not replace all for and for each loops with the
parallel equivalent. You will get into trouble
Ā© Copyright 2012 Avanade Inc. All Rights Reserved. Confidential For Internal Use Only
Ā© Copyright 2012 Avanade Inc. All Rights Reserved. Confidential For Internal Use Only
No ā€“ array cannot be divided into parts that can be sorted independently.
No, because the sum of the entire collection is needed, not the sums of
separate parts.
Yes, because each slide can be considered independently.
Ā© Copyright 2012 Avanade Inc. All Rights Reserved. Confidential For Internal Use Only
No. 21
Do you have distinct operations with well-
defined control dependencies and are these
operations largely free of serializing
dependencies?
Use the Parallel Task pattern
Ā© Copyright 2012 Avanade Inc. All Rights Reserved. Confidential For Internal Use Only
ā€¢ Sometimes referred to as Fork/Join pattern or the
Master/Worker pattern.
Parallel Tasks allow you to establish parallel
control flow in the style of fork and join.
ā€¢ Donā€™t assume that all parallel tasks will immediately run. That is
up to the scheduler.
You can wait for a single task or multiple tasks.
Ā© Copyright 2012 Avanade Inc. All Rights Reserved. Confidential For Internal Use Only
Ā© Copyright 2012 Avanade Inc. All Rights Reserved. Confidential For Internal Use Only
No. 24
Do you need to summarize data by applying some
kind of combination operator? Do you have loops
with steps that are not fully independent?
Use the Parallel Aggregation pattern
Ā© Copyright 2012 Avanade Inc. All Rights Reserved. Confidential For Internal Use Only
Introduces special steps in the algorithm for
merging partial results.
This pattern expresses a reduction operation and
includes map/reduce as one of its variations
Uses unshared, local variables that are merged at
the end of the computation to give the final
result
a.k.a. as The Parallel Reduction pattern because it
combines multiple inputs into a single output
Ā© Copyright 2012 Avanade Inc. All Rights Reserved. Confidential For Internal Use Only
Ā© Copyright 2012 Avanade Inc. All Rights Reserved. Confidential For Internal Use Only
Ā© Copyright 2012 Avanade Inc. All Rights Reserved. Confidential For Internal Use Only
No. 28
Does the ordering of steps in your algorithm
depend on data flow constraints?
Use the Futures pattern
Ā© Copyright 2012 Avanade Inc. All Rights Reserved. Confidential For Internal Use Only
Makes the data flow dependencies between tasks
explicit.
A future is a stand-in for a computational result
that is initially unknown but becomes known
The Futures pattern integrates task parallelism
with the familiar world of arguments and return
values
If a task in the chain is depending on another to
finish, it will block. The core will be available for
other tasks.
a.k.a Task Graph pattern.
Ā© Copyright 2012 Avanade Inc. All Rights Reserved. Confidential For Internal Use Only
No. 30
F1 F2
F3
F4
F5
F6
F1
F2
F3
F4
F5
F6
Method Chain Method Chain using Futures
Ā© Copyright 2012 Avanade Inc. All Rights Reserved. Confidential For Internal Use Only
Ā© Copyright 2012 Avanade Inc. All Rights Reserved. Confidential For Internal Use Only
No. 32
Does your application perform a sequence of
operations repetitively? Does the order of
processing matter?
Use the Pipeline pattern
Ā© Copyright 2012 Avanade Inc. All Rights Reserved. Confidential For Internal Use Only
Pipelines consist of components that are
connected by queues, in the style of producers
and consumers.
All the components run in parallel even though
the order of inputs is respected.
Analogous to assembly lines in a factory
Pipelines allow you to use parallelism in cases
where there are too many dependencies to use a
parallel loop
Ā© Copyright 2012 Avanade Inc. All Rights Reserved. Confidential For Internal Use Only
No. 34
Ā© Copyright 2012 Avanade Inc. All Rights Reserved. Confidential For Internal Use Only
Ā© Copyright 2012 Avanade Inc. All Rights Reserved. Confidential For Internal Use Only
Concurrency Visualizer
Debugging
Parallel Stacks Windows
Parallel Tasks Windows
Ā© Copyright 2012 Avanade Inc. All Rights Reserved. Confidential For Internal Use Only
ā€¢ Parallel Programming is expected in most software
ā€¢ Clearly understand the core design aspects
ā€¢ Decomposition
ā€¢ Coordination
ā€¢ Scalable Sharing
ā€¢ Get to know the 5 key parallel patterns
ā€¢ Parallel Loop
ā€¢ Parallel Tasks
ā€¢ Parallel Aggregation
ā€¢ Futures
ā€¢ Pipelines
ā€¢ Leverage industry tooling to make you experience
easier.
Ā© Copyright 2012 Avanade Inc. All Rights Reserved. Confidential For Internal Use Only

More Related Content

Similar to Sean Kenney - Solving Parallel Software Challenges with Patterns

j2ee Building components
j2ee Building components j2ee Building components
j2ee Building components adeppathondur
Ā 
Delivering Mobile Apps to the Field with Oracle JET
Delivering Mobile Apps to the Field with Oracle JETDelivering Mobile Apps to the Field with Oracle JET
Delivering Mobile Apps to the Field with Oracle JETSimon Haslam
Ā 
Moving the Guidewire platform to OSGi - Paul D'Albora
Moving the Guidewire platform to OSGi - Paul D'AlboraMoving the Guidewire platform to OSGi - Paul D'Albora
Moving the Guidewire platform to OSGi - Paul D'Alboramfrancis
Ā 
Gartner pace and bi-modal models
Gartner pace and bi-modal modelsGartner pace and bi-modal models
Gartner pace and bi-modal modelsRic Lukasiewicz
Ā 
Brownbag on basics of node.js
Brownbag on basics of node.jsBrownbag on basics of node.js
Brownbag on basics of node.jsJason Park
Ā 
Twelve Factor - Designing for Change
Twelve Factor - Designing for ChangeTwelve Factor - Designing for Change
Twelve Factor - Designing for ChangeEric Wyles
Ā 
Best Practices with CA Workload Automation AutoSys (AE)
Best Practices with CA Workload Automation AutoSys (AE)Best Practices with CA Workload Automation AutoSys (AE)
Best Practices with CA Workload Automation AutoSys (AE)CA Technologies
Ā 
Migrate Oracle WebLogic Applications onto a Containerized Cloud Data Center
Migrate Oracle WebLogic Applications onto a Containerized Cloud Data CenterMigrate Oracle WebLogic Applications onto a Containerized Cloud Data Center
Migrate Oracle WebLogic Applications onto a Containerized Cloud Data CenterJingnan Zhou
Ā 
Building and managing applications fast for IBM i
Building and managing applications fast for IBM iBuilding and managing applications fast for IBM i
Building and managing applications fast for IBM iZend by Rogue Wave Software
Ā 
Oracle WebLogic Server 12.2.1 Do More with Less
Oracle WebLogic Server 12.2.1 Do More with LessOracle WebLogic Server 12.2.1 Do More with Less
Oracle WebLogic Server 12.2.1 Do More with LessEd Burns
Ā 
OOW-TBE-12c-CON7307-Sharable
OOW-TBE-12c-CON7307-SharableOOW-TBE-12c-CON7307-Sharable
OOW-TBE-12c-CON7307-SharableObaidur (OB) Rashid
Ā 
NetApp IT Uses NetApp Manageability SDK to do More Than Configuration Tasks
NetApp IT Uses NetApp Manageability SDK to do More Than Configuration Tasks NetApp IT Uses NetApp Manageability SDK to do More Than Configuration Tasks
NetApp IT Uses NetApp Manageability SDK to do More Than Configuration Tasks NetApp
Ā 
Migrating from Oracle to Postgres
Migrating from Oracle to PostgresMigrating from Oracle to Postgres
Migrating from Oracle to PostgresEDB
Ā 
Oracle Enterprise Manager for MySQL
Oracle Enterprise Manager for MySQLOracle Enterprise Manager for MySQL
Oracle Enterprise Manager for MySQLMario Beck
Ā 
Platform Engineering for the Modern Oracle World
Platform Engineering for the Modern Oracle WorldPlatform Engineering for the Modern Oracle World
Platform Engineering for the Modern Oracle WorldSimon Haslam
Ā 
So we've done APM. Now what?
 So we've done APM. Now what? So we've done APM. Now what?
So we've done APM. Now what?SL Corporation
Ā 
Aem hub oak 0.2 full
Aem hub oak 0.2 fullAem hub oak 0.2 full
Aem hub oak 0.2 fullMichael Marth
Ā 
Delivering Java Applications? Ensure Top Performance Every Time, with Intell...
 Delivering Java Applications? Ensure Top Performance Every Time, with Intell... Delivering Java Applications? Ensure Top Performance Every Time, with Intell...
Delivering Java Applications? Ensure Top Performance Every Time, with Intell...John Williams
Ā 
Introduction To Groovy And Grails - SpringPeople
Introduction To Groovy And Grails - SpringPeopleIntroduction To Groovy And Grails - SpringPeople
Introduction To Groovy And Grails - SpringPeopleSpringPeople
Ā 
Why citizen developers should be your new best friend - Oracle APEX
Why citizen developers should be your new best friend - Oracle APEXWhy citizen developers should be your new best friend - Oracle APEX
Why citizen developers should be your new best friend - Oracle APEXDavidPeake15
Ā 

Similar to Sean Kenney - Solving Parallel Software Challenges with Patterns (20)

j2ee Building components
j2ee Building components j2ee Building components
j2ee Building components
Ā 
Delivering Mobile Apps to the Field with Oracle JET
Delivering Mobile Apps to the Field with Oracle JETDelivering Mobile Apps to the Field with Oracle JET
Delivering Mobile Apps to the Field with Oracle JET
Ā 
Moving the Guidewire platform to OSGi - Paul D'Albora
Moving the Guidewire platform to OSGi - Paul D'AlboraMoving the Guidewire platform to OSGi - Paul D'Albora
Moving the Guidewire platform to OSGi - Paul D'Albora
Ā 
Gartner pace and bi-modal models
Gartner pace and bi-modal modelsGartner pace and bi-modal models
Gartner pace and bi-modal models
Ā 
Brownbag on basics of node.js
Brownbag on basics of node.jsBrownbag on basics of node.js
Brownbag on basics of node.js
Ā 
Twelve Factor - Designing for Change
Twelve Factor - Designing for ChangeTwelve Factor - Designing for Change
Twelve Factor - Designing for Change
Ā 
Best Practices with CA Workload Automation AutoSys (AE)
Best Practices with CA Workload Automation AutoSys (AE)Best Practices with CA Workload Automation AutoSys (AE)
Best Practices with CA Workload Automation AutoSys (AE)
Ā 
Migrate Oracle WebLogic Applications onto a Containerized Cloud Data Center
Migrate Oracle WebLogic Applications onto a Containerized Cloud Data CenterMigrate Oracle WebLogic Applications onto a Containerized Cloud Data Center
Migrate Oracle WebLogic Applications onto a Containerized Cloud Data Center
Ā 
Building and managing applications fast for IBM i
Building and managing applications fast for IBM iBuilding and managing applications fast for IBM i
Building and managing applications fast for IBM i
Ā 
Oracle WebLogic Server 12.2.1 Do More with Less
Oracle WebLogic Server 12.2.1 Do More with LessOracle WebLogic Server 12.2.1 Do More with Less
Oracle WebLogic Server 12.2.1 Do More with Less
Ā 
OOW-TBE-12c-CON7307-Sharable
OOW-TBE-12c-CON7307-SharableOOW-TBE-12c-CON7307-Sharable
OOW-TBE-12c-CON7307-Sharable
Ā 
NetApp IT Uses NetApp Manageability SDK to do More Than Configuration Tasks
NetApp IT Uses NetApp Manageability SDK to do More Than Configuration Tasks NetApp IT Uses NetApp Manageability SDK to do More Than Configuration Tasks
NetApp IT Uses NetApp Manageability SDK to do More Than Configuration Tasks
Ā 
Migrating from Oracle to Postgres
Migrating from Oracle to PostgresMigrating from Oracle to Postgres
Migrating from Oracle to Postgres
Ā 
Oracle Enterprise Manager for MySQL
Oracle Enterprise Manager for MySQLOracle Enterprise Manager for MySQL
Oracle Enterprise Manager for MySQL
Ā 
Platform Engineering for the Modern Oracle World
Platform Engineering for the Modern Oracle WorldPlatform Engineering for the Modern Oracle World
Platform Engineering for the Modern Oracle World
Ā 
So we've done APM. Now what?
 So we've done APM. Now what? So we've done APM. Now what?
So we've done APM. Now what?
Ā 
Aem hub oak 0.2 full
Aem hub oak 0.2 fullAem hub oak 0.2 full
Aem hub oak 0.2 full
Ā 
Delivering Java Applications? Ensure Top Performance Every Time, with Intell...
 Delivering Java Applications? Ensure Top Performance Every Time, with Intell... Delivering Java Applications? Ensure Top Performance Every Time, with Intell...
Delivering Java Applications? Ensure Top Performance Every Time, with Intell...
Ā 
Introduction To Groovy And Grails - SpringPeople
Introduction To Groovy And Grails - SpringPeopleIntroduction To Groovy And Grails - SpringPeople
Introduction To Groovy And Grails - SpringPeople
Ā 
Why citizen developers should be your new best friend - Oracle APEX
Why citizen developers should be your new best friend - Oracle APEXWhy citizen developers should be your new best friend - Oracle APEX
Why citizen developers should be your new best friend - Oracle APEX
Ā 

More from iasaglobal

Adam boczek 2015 agile architecture in 10 steps v1.0
Adam boczek 2015 agile architecture in 10 steps v1.0Adam boczek 2015 agile architecture in 10 steps v1.0
Adam boczek 2015 agile architecture in 10 steps v1.0iasaglobal
Ā 
Adam boczek 2015 agile architecture in 10 steps v1.0
Adam boczek 2015 agile architecture in 10 steps v1.0Adam boczek 2015 agile architecture in 10 steps v1.0
Adam boczek 2015 agile architecture in 10 steps v1.0iasaglobal
Ā 
Adam boczek 2013 bitkom software summit agile architecture v1.3
Adam boczek 2013 bitkom software summit agile architecture v1.3Adam boczek 2013 bitkom software summit agile architecture v1.3
Adam boczek 2013 bitkom software summit agile architecture v1.3iasaglobal
Ā 
Essentials of enterprise architecture tools
Essentials of enterprise architecture toolsEssentials of enterprise architecture tools
Essentials of enterprise architecture toolsiasaglobal
Ā 
Understanding business strategy cutting edge paradigm
Understanding business strategy cutting edge paradigmUnderstanding business strategy cutting edge paradigm
Understanding business strategy cutting edge paradigmiasaglobal
Ā 
Information and data relevance to business
Information and data relevance to businessInformation and data relevance to business
Information and data relevance to businessiasaglobal
Ā 
Case study value of it strategy in hi tech industry
Case study value of it strategy in hi tech industryCase study value of it strategy in hi tech industry
Case study value of it strategy in hi tech industryiasaglobal
Ā 
Max Poliashenko - Enterprise Product Architecture
Max Poliashenko - Enterprise Product ArchitectureMax Poliashenko - Enterprise Product Architecture
Max Poliashenko - Enterprise Product Architectureiasaglobal
Ā 
Michael Gonzalez - Do The Sum of The Parts Equal the Whole
Michael Gonzalez - Do The Sum of The Parts Equal the WholeMichael Gonzalez - Do The Sum of The Parts Equal the Whole
Michael Gonzalez - Do The Sum of The Parts Equal the Wholeiasaglobal
Ā 
Michael Jay Freer - Information Obfuscation
Michael Jay Freer - Information ObfuscationMichael Jay Freer - Information Obfuscation
Michael Jay Freer - Information Obfuscationiasaglobal
Ā 
Creating Enterprise Value from Business Architecture
Creating Enterprise Value from Business ArchitectureCreating Enterprise Value from Business Architecture
Creating Enterprise Value from Business Architectureiasaglobal
Ā 
Scott Whitmire - Just What is Architecture Anyway
Scott Whitmire - Just What is Architecture AnywayScott Whitmire - Just What is Architecture Anyway
Scott Whitmire - Just What is Architecture Anywayiasaglobal
Ā 
Board of Education Vision 2013-2014
Board of Education Vision 2013-2014Board of Education Vision 2013-2014
Board of Education Vision 2013-2014iasaglobal
Ā 
Sheila Jeffrey - Well Behaved Data - It's a Matter of Principles
Sheila Jeffrey - Well Behaved Data - It's a Matter of PrinciplesSheila Jeffrey - Well Behaved Data - It's a Matter of Principles
Sheila Jeffrey - Well Behaved Data - It's a Matter of Principlesiasaglobal
Ā 
Stephen Cohen - The Impact of Ethics on the Architect
Stephen Cohen - The Impact of Ethics on the ArchitectStephen Cohen - The Impact of Ethics on the Architect
Stephen Cohen - The Impact of Ethics on the Architectiasaglobal
Ā 
William Martinez - Evolution Game
William Martinez - Evolution GameWilliam Martinez - Evolution Game
William Martinez - Evolution Gameiasaglobal
Ā 
Paul Preiss - Enterprise Architecture in Transformation
Paul Preiss - Enterprise Architecture in TransformationPaul Preiss - Enterprise Architecture in Transformation
Paul Preiss - Enterprise Architecture in Transformationiasaglobal
Ā 
Nina Grantcharova - Approach to Separation of Concerns via Design Patterns
Nina Grantcharova - Approach to Separation of Concerns via Design PatternsNina Grantcharova - Approach to Separation of Concerns via Design Patterns
Nina Grantcharova - Approach to Separation of Concerns via Design Patternsiasaglobal
Ā 
Roger Sessions - The Snowman Architecture
Roger Sessions - The Snowman ArchitectureRoger Sessions - The Snowman Architecture
Roger Sessions - The Snowman Architectureiasaglobal
Ā 
Strategic Portfolio Management for IT
Strategic Portfolio Management for ITStrategic Portfolio Management for IT
Strategic Portfolio Management for ITiasaglobal
Ā 

More from iasaglobal (20)

Adam boczek 2015 agile architecture in 10 steps v1.0
Adam boczek 2015 agile architecture in 10 steps v1.0Adam boczek 2015 agile architecture in 10 steps v1.0
Adam boczek 2015 agile architecture in 10 steps v1.0
Ā 
Adam boczek 2015 agile architecture in 10 steps v1.0
Adam boczek 2015 agile architecture in 10 steps v1.0Adam boczek 2015 agile architecture in 10 steps v1.0
Adam boczek 2015 agile architecture in 10 steps v1.0
Ā 
Adam boczek 2013 bitkom software summit agile architecture v1.3
Adam boczek 2013 bitkom software summit agile architecture v1.3Adam boczek 2013 bitkom software summit agile architecture v1.3
Adam boczek 2013 bitkom software summit agile architecture v1.3
Ā 
Essentials of enterprise architecture tools
Essentials of enterprise architecture toolsEssentials of enterprise architecture tools
Essentials of enterprise architecture tools
Ā 
Understanding business strategy cutting edge paradigm
Understanding business strategy cutting edge paradigmUnderstanding business strategy cutting edge paradigm
Understanding business strategy cutting edge paradigm
Ā 
Information and data relevance to business
Information and data relevance to businessInformation and data relevance to business
Information and data relevance to business
Ā 
Case study value of it strategy in hi tech industry
Case study value of it strategy in hi tech industryCase study value of it strategy in hi tech industry
Case study value of it strategy in hi tech industry
Ā 
Max Poliashenko - Enterprise Product Architecture
Max Poliashenko - Enterprise Product ArchitectureMax Poliashenko - Enterprise Product Architecture
Max Poliashenko - Enterprise Product Architecture
Ā 
Michael Gonzalez - Do The Sum of The Parts Equal the Whole
Michael Gonzalez - Do The Sum of The Parts Equal the WholeMichael Gonzalez - Do The Sum of The Parts Equal the Whole
Michael Gonzalez - Do The Sum of The Parts Equal the Whole
Ā 
Michael Jay Freer - Information Obfuscation
Michael Jay Freer - Information ObfuscationMichael Jay Freer - Information Obfuscation
Michael Jay Freer - Information Obfuscation
Ā 
Creating Enterprise Value from Business Architecture
Creating Enterprise Value from Business ArchitectureCreating Enterprise Value from Business Architecture
Creating Enterprise Value from Business Architecture
Ā 
Scott Whitmire - Just What is Architecture Anyway
Scott Whitmire - Just What is Architecture AnywayScott Whitmire - Just What is Architecture Anyway
Scott Whitmire - Just What is Architecture Anyway
Ā 
Board of Education Vision 2013-2014
Board of Education Vision 2013-2014Board of Education Vision 2013-2014
Board of Education Vision 2013-2014
Ā 
Sheila Jeffrey - Well Behaved Data - It's a Matter of Principles
Sheila Jeffrey - Well Behaved Data - It's a Matter of PrinciplesSheila Jeffrey - Well Behaved Data - It's a Matter of Principles
Sheila Jeffrey - Well Behaved Data - It's a Matter of Principles
Ā 
Stephen Cohen - The Impact of Ethics on the Architect
Stephen Cohen - The Impact of Ethics on the ArchitectStephen Cohen - The Impact of Ethics on the Architect
Stephen Cohen - The Impact of Ethics on the Architect
Ā 
William Martinez - Evolution Game
William Martinez - Evolution GameWilliam Martinez - Evolution Game
William Martinez - Evolution Game
Ā 
Paul Preiss - Enterprise Architecture in Transformation
Paul Preiss - Enterprise Architecture in TransformationPaul Preiss - Enterprise Architecture in Transformation
Paul Preiss - Enterprise Architecture in Transformation
Ā 
Nina Grantcharova - Approach to Separation of Concerns via Design Patterns
Nina Grantcharova - Approach to Separation of Concerns via Design PatternsNina Grantcharova - Approach to Separation of Concerns via Design Patterns
Nina Grantcharova - Approach to Separation of Concerns via Design Patterns
Ā 
Roger Sessions - The Snowman Architecture
Roger Sessions - The Snowman ArchitectureRoger Sessions - The Snowman Architecture
Roger Sessions - The Snowman Architecture
Ā 
Strategic Portfolio Management for IT
Strategic Portfolio Management for ITStrategic Portfolio Management for IT
Strategic Portfolio Management for IT
Ā 

Recently uploaded

Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityWSO2
Ā 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfOrbitshub
Ā 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
Ā 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
Ā 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
Ā 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
Ā 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontologyjohnbeverley2021
Ā 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...apidays
Ā 
Mcleodganj Call Girls šŸ„° 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls šŸ„° 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls šŸ„° 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls šŸ„° 8617370543 Service Offer VIP Hot ModelDeepika Singh
Ā 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Christopher Logan Kennedy
Ā 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
Ā 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
Ā 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
Ā 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
Ā 
Introduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDMIntroduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDMKumar Satyam
Ā 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...apidays
Ā 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
Ā 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKJago de Vreede
Ā 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
Ā 

Recently uploaded (20)

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
Ā 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
Ā 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Ā 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
Ā 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
Ā 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
Ā 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
Ā 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
Ā 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Ā 
Mcleodganj Call Girls šŸ„° 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls šŸ„° 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls šŸ„° 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls šŸ„° 8617370543 Service Offer VIP Hot Model
Ā 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
Ā 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
Ā 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Ā 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Ā 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Ā 
Introduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDMIntroduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDM
Ā 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Ā 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
Ā 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Ā 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Ā 

Sean Kenney - Solving Parallel Software Challenges with Patterns

  • 2. Ā© Copyright 2012 Avanade Inc. All Rights Reserved. Confidential For Internal Use Only No. 2
  • 3. Ā© Copyright 2012 Avanade Inc. All Rights Reserved. Confidential For Internal Use Only No. 3
  • 4. Ā© Copyright 2012 Avanade Inc. All Rights Reserved. Confidential For Internal Use Only No. 4 Architect Developer Tester Product Management Business Management
  • 5. Ā© Copyright 2012 Avanade Inc. All Rights Reserved. Confidential For Internal Use Only No. 5 Most servers today both have multi-core and multi-processor architecture You should not rely on the OS to do parallel programming Parallel programming is just not for Super Geeks any more (Driver developers, OS developers, C++ guys) All verticals are starting to want/need parallel programming Parallel programming can be leveraged well in some cloud scenarios
  • 6. Ā© Copyright 2012 Avanade Inc. All Rights Reserved. Confidential For Internal Use Only Beijing National Stadium - a.k.a ā€œBirdā€™s Nestā€
  • 7. Ā© Copyright 2012 Avanade Inc. All Rights Reserved. Confidential For Internal Use Only
  • 8. Ā© Copyright 2012 Avanade Inc. All Rights Reserved. Confidential For Internal Use Only Concurrency ā€¢ GOAL: Prevent thread starvation ā€¢ concept related to multitasking and asynchronous input-output (I/O) ā€¢ existence of multiple threads of execution that may each get a slice of time to execute before being preempted by another thread Parallelism ā€¢ GOAL: Maximize processor usage across all available cores ā€¢ concurrent threads execute at the same time across cores ā€¢ focuses on improving the performance of applications that use a lot of processor power and are not constantly interrupted when multiple cores are available.
  • 9. Ā© Copyright 2012 Avanade Inc. All Rights Reserved. Confidential For Internal Use Only No. 9
  • 10. Ā© Copyright 2012 Avanade Inc. All Rights Reserved. Confidential For Internal Use Only TPL for .net MPL Express/JFFP RiverTrail for Javascript
  • 11. Ā© Copyright 2012 Avanade Inc. All Rights Reserved. Confidential For Internal Use Only Decomposition Coordination Scalable Sharing
  • 12. Ā© Copyright 2012 Avanade Inc. All Rights Reserved. Confidential For Internal Use Only No. 12 ā€¢ Too fine = overhead to manage will become to much ā€¢ Too course = parallel opportunities will be lost Identify tasks at a level of granularity that results in efficient use of hardware resources. ā€¢ They should remain independent of each other, and have enough tasks to keep the cores busy Tasks should be as large as possible ā€¢ Dedicate some time to understand these components. Decomposing a problem into tasks requires a good understanding of the algorithmic and structural aspects of your application.
  • 13. Ā© Copyright 2012 Avanade Inc. All Rights Reserved. Confidential For Internal Use Only Seanā€™s General Rule of thumb: If iteration takes longer than 1 minute, review further.
  • 14. Ā© Copyright 2012 Avanade Inc. All Rights Reserved. Confidential For Internal Use Only No. 14 Coordination depends on specifically which parallel patterns you use to implement Application algorithms are constrained by order of execution and degree of parallelism ā€¢ Constraints can come from data flow or control flow. The Futures pattern uses Continuation to manage coordination. ā€¢ Make sure that you understand any coordination, before modifying you application. Mapping out dependencies in a graph or inheritance tree helps truly understand the landscape
  • 15. Ā© Copyright 2012 Avanade Inc. All Rights Reserved. Confidential For Internal Use Only No. 15 Limit your shared variables Use immutable data when you can Introduce new steps in your algorithm that merge local versions of mutable state at checkpoints Adding synchronization reduces the parallelism of your application.
  • 16. Parallel Loop Parallel Tasks Parallel Aggregation Futures Pipelines
  • 17. Ā© Copyright 2012 Avanade Inc. All Rights Reserved. Confidential For Internal Use Only No. 17 Do you have sequential loops where there's no communication among the steps of each iteration? Use the Parallel Loop pattern
  • 18. Ā© Copyright 2012 Avanade Inc. All Rights Reserved. Confidential For Internal Use Only Parallel loops apply an independent operation to multiple inputs simultaneously. Very similar to for and foreach. Sequence in the collection will not matter. Do not replace all for and for each loops with the parallel equivalent. You will get into trouble
  • 19. Ā© Copyright 2012 Avanade Inc. All Rights Reserved. Confidential For Internal Use Only
  • 20. Ā© Copyright 2012 Avanade Inc. All Rights Reserved. Confidential For Internal Use Only No ā€“ array cannot be divided into parts that can be sorted independently. No, because the sum of the entire collection is needed, not the sums of separate parts. Yes, because each slide can be considered independently.
  • 21. Ā© Copyright 2012 Avanade Inc. All Rights Reserved. Confidential For Internal Use Only No. 21 Do you have distinct operations with well- defined control dependencies and are these operations largely free of serializing dependencies? Use the Parallel Task pattern
  • 22. Ā© Copyright 2012 Avanade Inc. All Rights Reserved. Confidential For Internal Use Only ā€¢ Sometimes referred to as Fork/Join pattern or the Master/Worker pattern. Parallel Tasks allow you to establish parallel control flow in the style of fork and join. ā€¢ Donā€™t assume that all parallel tasks will immediately run. That is up to the scheduler. You can wait for a single task or multiple tasks.
  • 23. Ā© Copyright 2012 Avanade Inc. All Rights Reserved. Confidential For Internal Use Only
  • 24. Ā© Copyright 2012 Avanade Inc. All Rights Reserved. Confidential For Internal Use Only No. 24 Do you need to summarize data by applying some kind of combination operator? Do you have loops with steps that are not fully independent? Use the Parallel Aggregation pattern
  • 25. Ā© Copyright 2012 Avanade Inc. All Rights Reserved. Confidential For Internal Use Only Introduces special steps in the algorithm for merging partial results. This pattern expresses a reduction operation and includes map/reduce as one of its variations Uses unshared, local variables that are merged at the end of the computation to give the final result a.k.a. as The Parallel Reduction pattern because it combines multiple inputs into a single output
  • 26. Ā© Copyright 2012 Avanade Inc. All Rights Reserved. Confidential For Internal Use Only
  • 27. Ā© Copyright 2012 Avanade Inc. All Rights Reserved. Confidential For Internal Use Only
  • 28. Ā© Copyright 2012 Avanade Inc. All Rights Reserved. Confidential For Internal Use Only No. 28 Does the ordering of steps in your algorithm depend on data flow constraints? Use the Futures pattern
  • 29. Ā© Copyright 2012 Avanade Inc. All Rights Reserved. Confidential For Internal Use Only Makes the data flow dependencies between tasks explicit. A future is a stand-in for a computational result that is initially unknown but becomes known The Futures pattern integrates task parallelism with the familiar world of arguments and return values If a task in the chain is depending on another to finish, it will block. The core will be available for other tasks. a.k.a Task Graph pattern.
  • 30. Ā© Copyright 2012 Avanade Inc. All Rights Reserved. Confidential For Internal Use Only No. 30 F1 F2 F3 F4 F5 F6 F1 F2 F3 F4 F5 F6 Method Chain Method Chain using Futures
  • 31. Ā© Copyright 2012 Avanade Inc. All Rights Reserved. Confidential For Internal Use Only
  • 32. Ā© Copyright 2012 Avanade Inc. All Rights Reserved. Confidential For Internal Use Only No. 32 Does your application perform a sequence of operations repetitively? Does the order of processing matter? Use the Pipeline pattern
  • 33. Ā© Copyright 2012 Avanade Inc. All Rights Reserved. Confidential For Internal Use Only Pipelines consist of components that are connected by queues, in the style of producers and consumers. All the components run in parallel even though the order of inputs is respected. Analogous to assembly lines in a factory Pipelines allow you to use parallelism in cases where there are too many dependencies to use a parallel loop
  • 34. Ā© Copyright 2012 Avanade Inc. All Rights Reserved. Confidential For Internal Use Only No. 34
  • 35. Ā© Copyright 2012 Avanade Inc. All Rights Reserved. Confidential For Internal Use Only
  • 36.
  • 37. Ā© Copyright 2012 Avanade Inc. All Rights Reserved. Confidential For Internal Use Only Concurrency Visualizer Debugging Parallel Stacks Windows Parallel Tasks Windows
  • 38. Ā© Copyright 2012 Avanade Inc. All Rights Reserved. Confidential For Internal Use Only ā€¢ Parallel Programming is expected in most software ā€¢ Clearly understand the core design aspects ā€¢ Decomposition ā€¢ Coordination ā€¢ Scalable Sharing ā€¢ Get to know the 5 key parallel patterns ā€¢ Parallel Loop ā€¢ Parallel Tasks ā€¢ Parallel Aggregation ā€¢ Futures ā€¢ Pipelines ā€¢ Leverage industry tooling to make you experience easier.
  • 39. Ā© Copyright 2012 Avanade Inc. All Rights Reserved. Confidential For Internal Use Only