SlideShare ist ein Scribd-Unternehmen logo
1 von 39
Downloaden Sie, um offline zu lesen
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

Weitere ähnliche Inhalte

Ähnlich wie 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
 
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
 

Ähnlich wie 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
 

Mehr von 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
 

Mehr von 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
 

Kürzlich hochgeladen

"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Zilliz
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityWSO2
 
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
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Zilliz
 
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
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
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
 
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
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Angeliki Cooney
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
 

Kürzlich hochgeladen (20)

"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
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, ...
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
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
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
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
 
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
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 

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