SlideShare ist ein Scribd-Unternehmen logo
1 von 43
Downloaden Sie, um offline zu lesen
Sankarsan Bose
 11th July 2010
 Concurrency
 Parallel Programming
 Parallel Extensions in .NET 4.0
    Coordination Data Structures
    Task Parallelism
    Parallel Loop /Data Parallelism
    Parallel LINQ
Concurrency
• Perform multiple            Program A Program B
                    computations
  What              in overlapping time         Step 1                T
                    periods                               Step1       I
                                                Step2                 M
                                                                      E
                  • Responsive UI                         Step2
                  • Asynchronous
   Why              Processing
                                                Step3
                                                          Step3
                  • Better performance(??)



Concurrency is almost everywhere…..

OS,Database,Web Servers,GUI programs, File processing….
Program


 Concurrent    Concurrent              Concurrent
Component 1   Component 2             Component N

                        Read/Write




                     Shared Memory


Shared Memory Model of Concurrency
OS Process



  Thread 1      Thread 2                Thread N

                           Read/Write




                        Shared Memory


Operating System View
Managed Program in CLR App Domain


  Managed       Managed                          Managed
  Thread 1      Thread 2                         Thread N

                           Read/Write




                      Shared Memory


.NET Common Language Runtime View
Create ThreadStart delegate
                with the method to be
                executed
                Create instance of Thread
                class with the ThreadStart
                delegate




Start the thread execution
 Synchronization    Issues
   Race Condition
   Deadlock
 Dependency on Memory Model & Hardware Architecture
 Debugging becomes complicated
Demo1
Run

             Suspend
Thread1                 Thread1

          Suspend
Thread2                 Thread2

            Run        Single Core
Program
                        Processor
Run
      Thread1                                                     Thread1

                                                                   Core1

                                       Run
      Thread2                                                     Thread2

                                                                   Core2
      Program
                                                            Multi Core Processor


Concurrency - Perform multiple computations in overlapping     time periods
Parallel - Perform multiple computations   simultaneously
Parallel
Programming
 No more increase in clock
                                                           speed
                                                            Increase in number of
                                                           processors
                                                            Sequential programs
                                                           won’t scale
                                                            Parallel Programming
                                                                To leverage hardware
                                                               advances




Source: PDC 09 Patterns of Parallel Programming Workshop
 Decompose the program into parts e.g. methods,
statements etc.
 Identify the parts which can be executed in parallel
 Assign each part to separate tasks
 Perform the tasks in parallel on different cores
 Each task is likely to perform different actions
 Partition the input data into multiple chunks
 Perform action on each chunk in parallel on different cores
 Merge the output results
 Can be scaled up with more processors as data volume grows
To develop applications for the multicore processors we need

  Design
      Identify parallel parts
      Apply correct design patterns


  Libraries
      Sophisticated synchronization features to avoid deadlocks/race etc.
      Thread safe data structures & containers
      Language/API support for common parallel programming patterns to achieve task/data
     parallelism.

  Tools
      For   debugging parallel applications
      For   profiling parallel applications



   Parallel Extensions in .NET 4.0
Parallel
Extensions in
  .NET 4.0
Integrated                   Programming Models                                                                  Programming Models
   Tooling
                                                 PLINQ
       Parallel                               Task Parallel                                                          Parallel Pattern      Agents
      Debugger                                                                                                           Library           Library
                                                Library
    Toolwindows




                                                                                Data Structures

                                                                                                  Data Structures
                                 Concurrency Runtime                                                                 Concurrency Runtime

                                              ThreadPool
      Profiler                                                                                                                Task Scheduler
    Concurrency                              Task Scheduler
      Analysis
                                            Resource Manager
                                                                                                                             Resource Manager

                                                                 Operating System

                                                                  Threads

                                  Key:         Managed Library        Native Library                                 Tools

Source: PDC 08 Daniel Moth’s Presentation
Thread-safe collections                    Phased Operation
 ConcurrentStack<T>
 ConcurrentQueue<T>
 ConcurrentDictionary<TKey,TValue>
                                            Locks
 Work exchange
 BlockingCollection<T>
 IProducerConsumerCollection<T>


 Initialization
 LazyInit<T>
Source: PDC 08 Daniel Moth’s Presentation
Demo2
Demo3
   APIs provided under System.Threading & Sytem.Threading.Tasks
   Behind the scenes uses CLR Thread Pool
   Uses sophisticated algorithms to assign number of threads to
    maximize performance
   More programmatic control than thread or work item
       Create/Start Tasks
       Return result values from tasks
       Chain Multiple Tasks
       Nested & Child Tasks
       Exception Handling
Constructor - public Task( Action action )
Action delegate - public delegate void Action()


                                                  Lambda Expression without
                                                  input parameter and
                                                  returning nothing

                                                  Create an explicit instance of
                                                  Action delegate and pass it to
                                                  task constructor




Start the Tasks
Class: public class Task<TResult> : Task
Constructor: public Task( Func<TResult> function )
Delegate: public delegate TResult Func<out TResult>()
                                                        Lambda Expression
                                                        without input
                                                        parameter and
                                                        returning int

                                                        Create new instance
                                                        of Func delegate with
                                                        no input parameter
                                                        and returning int

                                                        We have instantiated
                                                        & started two tasks
                                                        which expected to
                                                        return integer value




The property Result stores the return value
Class: public Task ContinueWith( Action<Task> continuationAction )



                                                                           Instantiate a Task
                                                                           with Action delegate

                                                                           Create an Action
                                                                           delegate with a task
                                                                           object as input and
                                                                           returning nothing.
                                                                           Call ContinueWith
                                                                           method and pass the
                                                                           Action delegate
                                                                           created



 Start the Task.
 After this task completes it will Continue With the execution of Action
 a2 automatically
This is a lambda
                                                            expression and Task
                                                            t1 will execute this
                                                            statements
                                                            Task t11 is created
                                                            while Task T1 is
                                                            executing.
                                                            This is a Nested Task




Task t12 is created while Task T1 is executing but with
AttachedToParent option. This is a Child Task.

Child tasks are very closely synchronized with the parent
Demo4
Method : public static void Invoke( params Action[] actions )




                                                           Three Action delegates are
                                                           created



                                                           Three Action delegates will be
                                                           invoked possibly in Parallel
Demo5
Method : public static ParallelLoopResult For( int fromInclusive, int toExclusive,
Action<int> body )



                                                                             Upper & Lower
                                                                             Bounds of the For
                                                                             Loop
                                                                             Loop Counter

                                                                             Statement
                                                                             executed in the
                                                                             loop




When a For() loop has a small body, it might perform more slowly
Slower performance is caused by the overhead involved in partitioning the data and the
cost of invoking a delegate on each loop iteration.
Method : public static ParallelLoopResult ForEach<TSource>( IEnumerable<TSource>
source, Action<TSource> body )

                                                               Int Array with
                                                               values from 0 to
                                                               100000
                                                               Loop iteration
                                                               variable


                                                               Loop Body
Demo6
   Language-Integrated Query (LINQ) was introduced in the .NET
    Framework version 3.0
       Querying on any System.Collections.IEnumerable or
        System.Collections.Generic.IEnumerable data source
   Parallel LINQ (PLINQ) is a parallel implementation of the LINQ
    pattern
   PLINQ tries to make full use of all the processors on the system
   Partitions the data source into segments
   Executes the query on each segment on separate worker threads
    in parallel on multiple processors
Method : public static ParallelQuery<TSource> AsParallel<TSource>( this
IEnumerable<TSource> source )
Method : public static void ForAll<TSource>( this ParallelQuery<TSource> source,
Action<TSource> action )



                                                                          Instructs to execute
                                                                          the LINQ query in
                                                                          Parallel

                                                                          Invokes in parallel the
                                                                          specified action for
                                                                          each element in the
                                                                          source.
Demo7
   PLINQ, the goal is to maximize performance while maintaining
    correctness
   In some cases, correctness requires the order of the source
    sequence to be preserved
   Ordering can be computationally expensive
   PLINQ by default does not preserve the order of the source
    sequence
   To turn on order-preservation the AsOrdered operator is to be
    used on the source sequence
Method : public static ParallelQuery AsOrdered( this ParallelQuery source )




     Instructs to execute the LINQ query in Parallel by
     preserving order
Demo8
Thank You
http://msdn.microsoft.com/en-us/library/dd460693.aspx

  http://channel9.msdn.com/pdc2008/TL26/

   http://www.ademiller.com/blogs/tech/2009/11/pdc-patterns-
of-parallel-programming-workshop/

  Concurrent Programming on Windows by Joe Duffy
Additional
  Slides
This is like a pointer to
                                           function which
                                           accepts nothing and
                                           returns nothing

                                           Accepts delegate D as
                                           input

                                           M2 has no parameter
                                           & return value

                                           An instance of
                                           delegate D or a
                                           pointer to method
                                           M2
                                           Call to M1 with
                                           delegate instance d1
                                           as a parameter.

                                           Call to M1 with
                                           Lambda Expression

Lambda Expression is an anonymous method
(input parameters) => (statement)

Weitere ähnliche Inhalte

Was ist angesagt?

Apache Kylin: Speed Up Cubing with Apache Spark with Luke Han and Shaofeng Shi
 Apache Kylin: Speed Up Cubing with Apache Spark with Luke Han and Shaofeng Shi Apache Kylin: Speed Up Cubing with Apache Spark with Luke Han and Shaofeng Shi
Apache Kylin: Speed Up Cubing with Apache Spark with Luke Han and Shaofeng ShiDatabricks
 
Efficient Data Storage for Analytics with Apache Parquet 2.0
Efficient Data Storage for Analytics with Apache Parquet 2.0Efficient Data Storage for Analytics with Apache Parquet 2.0
Efficient Data Storage for Analytics with Apache Parquet 2.0Cloudera, Inc.
 
[211] HBase 기반 검색 데이터 저장소 (공개용)
[211] HBase 기반 검색 데이터 저장소 (공개용)[211] HBase 기반 검색 데이터 저장소 (공개용)
[211] HBase 기반 검색 데이터 저장소 (공개용)NAVER D2
 
[AIS 2018] [Team Tools_Advanced] Confluence 100배 활용하기 - 커브
[AIS 2018] [Team Tools_Advanced] Confluence 100배 활용하기 - 커브[AIS 2018] [Team Tools_Advanced] Confluence 100배 활용하기 - 커브
[AIS 2018] [Team Tools_Advanced] Confluence 100배 활용하기 - 커브Atlassian 대한민국
 
백억개의 로그를 모아 검색하고 분석하고 학습도 시켜보자 : 로기스
백억개의 로그를 모아 검색하고 분석하고 학습도 시켜보자 : 로기스백억개의 로그를 모아 검색하고 분석하고 학습도 시켜보자 : 로기스
백억개의 로그를 모아 검색하고 분석하고 학습도 시켜보자 : 로기스NAVER D2
 
mongodb와 mysql의 CRUD 연산의 성능 비교
mongodb와 mysql의 CRUD 연산의 성능 비교mongodb와 mysql의 CRUD 연산의 성능 비교
mongodb와 mysql의 CRUD 연산의 성능 비교Woo Yeong Choi
 
Ozone: scaling HDFS to trillions of objects
Ozone: scaling HDFS to trillions of objectsOzone: scaling HDFS to trillions of objects
Ozone: scaling HDFS to trillions of objectsDataWorks Summit
 
Productionzing ML Model Using MLflow Model Serving
Productionzing ML Model Using MLflow Model ServingProductionzing ML Model Using MLflow Model Serving
Productionzing ML Model Using MLflow Model ServingDatabricks
 
Scalabilité de MongoDB
Scalabilité de MongoDBScalabilité de MongoDB
Scalabilité de MongoDBMongoDB
 
Simplify DevOps with Microservices and Mobile Backends.pptx
Simplify DevOps with Microservices and Mobile Backends.pptxSimplify DevOps with Microservices and Mobile Backends.pptx
Simplify DevOps with Microservices and Mobile Backends.pptxssuser5faa791
 
Real-Time Anomoly Detection with Spark MLib, Akka and Cassandra by Natalino Busa
Real-Time Anomoly Detection with Spark MLib, Akka and Cassandra by Natalino BusaReal-Time Anomoly Detection with Spark MLib, Akka and Cassandra by Natalino Busa
Real-Time Anomoly Detection with Spark MLib, Akka and Cassandra by Natalino BusaSpark Summit
 
Getting Started with HBase
Getting Started with HBaseGetting Started with HBase
Getting Started with HBaseCarol McDonald
 
Interactive Realtime Dashboards on Data Streams using Kafka, Druid and Superset
Interactive Realtime Dashboards on Data Streams using Kafka, Druid and SupersetInteractive Realtime Dashboards on Data Streams using Kafka, Druid and Superset
Interactive Realtime Dashboards on Data Streams using Kafka, Druid and SupersetHortonworks
 
Apache Tez – Present and Future
Apache Tez – Present and FutureApache Tez – Present and Future
Apache Tez – Present and FutureDataWorks Summit
 
HDFS Namenode High Availability
HDFS Namenode High AvailabilityHDFS Namenode High Availability
HDFS Namenode High AvailabilityHortonworks
 
Low Latency OLAP with Hadoop and HBase
Low Latency OLAP with Hadoop and HBaseLow Latency OLAP with Hadoop and HBase
Low Latency OLAP with Hadoop and HBaseDataWorks Summit
 
Real-Time Data Flows with Apache NiFi
Real-Time Data Flows with Apache NiFiReal-Time Data Flows with Apache NiFi
Real-Time Data Flows with Apache NiFiManish Gupta
 
Designing ETL Pipelines with Structured Streaming and Delta Lake—How to Archi...
Designing ETL Pipelines with Structured Streaming and Delta Lake—How to Archi...Designing ETL Pipelines with Structured Streaming and Delta Lake—How to Archi...
Designing ETL Pipelines with Structured Streaming and Delta Lake—How to Archi...Databricks
 
Présentation de Apache Zookeeper
Présentation de Apache ZookeeperPrésentation de Apache Zookeeper
Présentation de Apache ZookeeperMichaël Morello
 

Was ist angesagt? (20)

Apache Kylin: Speed Up Cubing with Apache Spark with Luke Han and Shaofeng Shi
 Apache Kylin: Speed Up Cubing with Apache Spark with Luke Han and Shaofeng Shi Apache Kylin: Speed Up Cubing with Apache Spark with Luke Han and Shaofeng Shi
Apache Kylin: Speed Up Cubing with Apache Spark with Luke Han and Shaofeng Shi
 
Efficient Data Storage for Analytics with Apache Parquet 2.0
Efficient Data Storage for Analytics with Apache Parquet 2.0Efficient Data Storage for Analytics with Apache Parquet 2.0
Efficient Data Storage for Analytics with Apache Parquet 2.0
 
[211] HBase 기반 검색 데이터 저장소 (공개용)
[211] HBase 기반 검색 데이터 저장소 (공개용)[211] HBase 기반 검색 데이터 저장소 (공개용)
[211] HBase 기반 검색 데이터 저장소 (공개용)
 
[AIS 2018] [Team Tools_Advanced] Confluence 100배 활용하기 - 커브
[AIS 2018] [Team Tools_Advanced] Confluence 100배 활용하기 - 커브[AIS 2018] [Team Tools_Advanced] Confluence 100배 활용하기 - 커브
[AIS 2018] [Team Tools_Advanced] Confluence 100배 활용하기 - 커브
 
백억개의 로그를 모아 검색하고 분석하고 학습도 시켜보자 : 로기스
백억개의 로그를 모아 검색하고 분석하고 학습도 시켜보자 : 로기스백억개의 로그를 모아 검색하고 분석하고 학습도 시켜보자 : 로기스
백억개의 로그를 모아 검색하고 분석하고 학습도 시켜보자 : 로기스
 
mongodb와 mysql의 CRUD 연산의 성능 비교
mongodb와 mysql의 CRUD 연산의 성능 비교mongodb와 mysql의 CRUD 연산의 성능 비교
mongodb와 mysql의 CRUD 연산의 성능 비교
 
Ozone: scaling HDFS to trillions of objects
Ozone: scaling HDFS to trillions of objectsOzone: scaling HDFS to trillions of objects
Ozone: scaling HDFS to trillions of objects
 
Productionzing ML Model Using MLflow Model Serving
Productionzing ML Model Using MLflow Model ServingProductionzing ML Model Using MLflow Model Serving
Productionzing ML Model Using MLflow Model Serving
 
Scalabilité de MongoDB
Scalabilité de MongoDBScalabilité de MongoDB
Scalabilité de MongoDB
 
Simplify DevOps with Microservices and Mobile Backends.pptx
Simplify DevOps with Microservices and Mobile Backends.pptxSimplify DevOps with Microservices and Mobile Backends.pptx
Simplify DevOps with Microservices and Mobile Backends.pptx
 
HBase Low Latency
HBase Low LatencyHBase Low Latency
HBase Low Latency
 
Real-Time Anomoly Detection with Spark MLib, Akka and Cassandra by Natalino Busa
Real-Time Anomoly Detection with Spark MLib, Akka and Cassandra by Natalino BusaReal-Time Anomoly Detection with Spark MLib, Akka and Cassandra by Natalino Busa
Real-Time Anomoly Detection with Spark MLib, Akka and Cassandra by Natalino Busa
 
Getting Started with HBase
Getting Started with HBaseGetting Started with HBase
Getting Started with HBase
 
Interactive Realtime Dashboards on Data Streams using Kafka, Druid and Superset
Interactive Realtime Dashboards on Data Streams using Kafka, Druid and SupersetInteractive Realtime Dashboards on Data Streams using Kafka, Druid and Superset
Interactive Realtime Dashboards on Data Streams using Kafka, Druid and Superset
 
Apache Tez – Present and Future
Apache Tez – Present and FutureApache Tez – Present and Future
Apache Tez – Present and Future
 
HDFS Namenode High Availability
HDFS Namenode High AvailabilityHDFS Namenode High Availability
HDFS Namenode High Availability
 
Low Latency OLAP with Hadoop and HBase
Low Latency OLAP with Hadoop and HBaseLow Latency OLAP with Hadoop and HBase
Low Latency OLAP with Hadoop and HBase
 
Real-Time Data Flows with Apache NiFi
Real-Time Data Flows with Apache NiFiReal-Time Data Flows with Apache NiFi
Real-Time Data Flows with Apache NiFi
 
Designing ETL Pipelines with Structured Streaming and Delta Lake—How to Archi...
Designing ETL Pipelines with Structured Streaming and Delta Lake—How to Archi...Designing ETL Pipelines with Structured Streaming and Delta Lake—How to Archi...
Designing ETL Pipelines with Structured Streaming and Delta Lake—How to Archi...
 
Présentation de Apache Zookeeper
Présentation de Apache ZookeeperPrésentation de Apache Zookeeper
Présentation de Apache Zookeeper
 

Andere mochten auch

Perl 6 for Concurrency and Parallel Computing
Perl 6 for Concurrency and Parallel ComputingPerl 6 for Concurrency and Parallel Computing
Perl 6 for Concurrency and Parallel ComputingAndrew Shitov
 
Effective java - concurrency
Effective java - concurrencyEffective java - concurrency
Effective java - concurrencyfeng lee
 
Concurrency: Best Practices
Concurrency: Best PracticesConcurrency: Best Practices
Concurrency: Best PracticesIndicThreads
 
Windows programming
Windows programmingWindows programming
Windows programmingBapan Maity
 
Concurrency & Parallel Programming
Concurrency & Parallel ProgrammingConcurrency & Parallel Programming
Concurrency & Parallel ProgrammingRamazan AYYILDIZ
 
Network programming in java - PPT
Network programming in java - PPTNetwork programming in java - PPT
Network programming in java - PPTkamal kotecha
 
Microprocessor Week 10: Applications
Microprocessor Week 10: ApplicationsMicroprocessor Week 10: Applications
Microprocessor Week 10: ApplicationsArkhom Jodtang
 
Enterprise Management with Microsoft Technologies
Enterprise Management with Microsoft TechnologiesEnterprise Management with Microsoft Technologies
Enterprise Management with Microsoft TechnologiesAmit Gatenyo
 
Microsoft Dynamics NAV 2009 R2
Microsoft Dynamics NAV 2009 R2Microsoft Dynamics NAV 2009 R2
Microsoft Dynamics NAV 2009 R2Softera Baltic
 
LeverX - A Comprehensive Guide to SAP PLM 7.01
LeverX - A Comprehensive Guide to SAP PLM 7.01LeverX - A Comprehensive Guide to SAP PLM 7.01
LeverX - A Comprehensive Guide to SAP PLM 7.01LeverX
 
Introduction to-microprocessors
Introduction to-microprocessorsIntroduction to-microprocessors
Introduction to-microprocessorsmudulin
 
Microsoft dynamics navision 2009 r2
Microsoft dynamics navision 2009 r2Microsoft dynamics navision 2009 r2
Microsoft dynamics navision 2009 r2nikhil patel
 
Microprocessors-based systems (under graduate course) Lecture 1 of 9
Microprocessors-based systems (under graduate course) Lecture 1 of 9 Microprocessors-based systems (under graduate course) Lecture 1 of 9
Microprocessors-based systems (under graduate course) Lecture 1 of 9 Randa Elanwar
 
ECESLU Microprocessors lecture 2
ECESLU Microprocessors lecture 2ECESLU Microprocessors lecture 2
ECESLU Microprocessors lecture 2Jeffrey Des Binwag
 
ECESLU Microprocessors Lecture 3
ECESLU Microprocessors Lecture 3ECESLU Microprocessors Lecture 3
ECESLU Microprocessors Lecture 3Jeffrey Des Binwag
 
SharePoint PerformancePoint 101
SharePoint PerformancePoint 101SharePoint PerformancePoint 101
SharePoint PerformancePoint 101Matthew Carter
 

Andere mochten auch (20)

Perl 6 for Concurrency and Parallel Computing
Perl 6 for Concurrency and Parallel ComputingPerl 6 for Concurrency and Parallel Computing
Perl 6 for Concurrency and Parallel Computing
 
Basic Concepts in Wireless LAN
Basic Concepts in Wireless LANBasic Concepts in Wireless LAN
Basic Concepts in Wireless LAN
 
Effective java - concurrency
Effective java - concurrencyEffective java - concurrency
Effective java - concurrency
 
Concurrency: Best Practices
Concurrency: Best PracticesConcurrency: Best Practices
Concurrency: Best Practices
 
Windows programming
Windows programmingWindows programming
Windows programming
 
079 Network Programming
079 Network Programming079 Network Programming
079 Network Programming
 
Concurrency & Parallel Programming
Concurrency & Parallel ProgrammingConcurrency & Parallel Programming
Concurrency & Parallel Programming
 
Network programming in java - PPT
Network programming in java - PPTNetwork programming in java - PPT
Network programming in java - PPT
 
Microprocessor Week 10: Applications
Microprocessor Week 10: ApplicationsMicroprocessor Week 10: Applications
Microprocessor Week 10: Applications
 
Enterprise Management with Microsoft Technologies
Enterprise Management with Microsoft TechnologiesEnterprise Management with Microsoft Technologies
Enterprise Management with Microsoft Technologies
 
Microsoft Dynamics NAV 2009 R2
Microsoft Dynamics NAV 2009 R2Microsoft Dynamics NAV 2009 R2
Microsoft Dynamics NAV 2009 R2
 
LeverX - A Comprehensive Guide to SAP PLM 7.01
LeverX - A Comprehensive Guide to SAP PLM 7.01LeverX - A Comprehensive Guide to SAP PLM 7.01
LeverX - A Comprehensive Guide to SAP PLM 7.01
 
Cheap HPC
Cheap HPCCheap HPC
Cheap HPC
 
Introduction to-microprocessors
Introduction to-microprocessorsIntroduction to-microprocessors
Introduction to-microprocessors
 
Microsoft dynamics navision 2009 r2
Microsoft dynamics navision 2009 r2Microsoft dynamics navision 2009 r2
Microsoft dynamics navision 2009 r2
 
Microprocessors-based systems (under graduate course) Lecture 1 of 9
Microprocessors-based systems (under graduate course) Lecture 1 of 9 Microprocessors-based systems (under graduate course) Lecture 1 of 9
Microprocessors-based systems (under graduate course) Lecture 1 of 9
 
Microprocessor Systems
Microprocessor Systems Microprocessor Systems
Microprocessor Systems
 
ECESLU Microprocessors lecture 2
ECESLU Microprocessors lecture 2ECESLU Microprocessors lecture 2
ECESLU Microprocessors lecture 2
 
ECESLU Microprocessors Lecture 3
ECESLU Microprocessors Lecture 3ECESLU Microprocessors Lecture 3
ECESLU Microprocessors Lecture 3
 
SharePoint PerformancePoint 101
SharePoint PerformancePoint 101SharePoint PerformancePoint 101
SharePoint PerformancePoint 101
 

Ähnlich wie Parallel Programming in .NET

Tim - FSharp
Tim - FSharpTim - FSharp
Tim - FSharpd0nn9n
 
Overall 23 11_2007_hdp
Overall 23 11_2007_hdpOverall 23 11_2007_hdp
Overall 23 11_2007_hdpMohd Arif
 
Thinking in parallel ab tuladev
Thinking in parallel ab tuladevThinking in parallel ab tuladev
Thinking in parallel ab tuladevPavel Tsukanov
 
GPars: Groovy Parallelism for Java
GPars: Groovy Parallelism for JavaGPars: Groovy Parallelism for Java
GPars: Groovy Parallelism for JavaRussel Winder
 
(ATS3-PLAT06) Handling “Big Data” with Pipeline Pilot (MapReduce/NoSQL)
(ATS3-PLAT06) Handling “Big Data” with Pipeline Pilot (MapReduce/NoSQL)(ATS3-PLAT06) Handling “Big Data” with Pipeline Pilot (MapReduce/NoSQL)
(ATS3-PLAT06) Handling “Big Data” with Pipeline Pilot (MapReduce/NoSQL)BIOVIA
 
CH03.ppt dsqdDQWDQWDQWDWDQDQDQWDQQDDQDWDQWQ
CH03.ppt dsqdDQWDQWDQWDWDQDQDQWDQQDDQDWDQWQCH03.ppt dsqdDQWDQWDQWDWDQDQDQWDQQDDQDWDQWQ
CH03.ppt dsqdDQWDQWDQWDWDQDQDQWDQQDDQDWDQWQSandeepNayal1
 
Multi core programming 1
Multi core programming 1Multi core programming 1
Multi core programming 1Robin Aggarwal
 
VTU 6th Sem Elective CSE - Module 3 cloud computing
VTU 6th Sem Elective CSE - Module 3 cloud computingVTU 6th Sem Elective CSE - Module 3 cloud computing
VTU 6th Sem Elective CSE - Module 3 cloud computingSachin Gowda
 
Concurrency Programming in Java - 01 - Introduction to Concurrency Programming
Concurrency Programming in Java - 01 - Introduction to Concurrency ProgrammingConcurrency Programming in Java - 01 - Introduction to Concurrency Programming
Concurrency Programming in Java - 01 - Introduction to Concurrency ProgrammingSachintha Gunasena
 
MEW22 22nd Machine Evaluation Workshop Microsoft
MEW22 22nd Machine Evaluation Workshop MicrosoftMEW22 22nd Machine Evaluation Workshop Microsoft
MEW22 22nd Machine Evaluation Workshop MicrosoftLee Stott
 
WORKS 11 Presentation
WORKS 11 PresentationWORKS 11 Presentation
WORKS 11 Presentationdgarijo
 
ACM Sunnyvale Meetup.pdf
ACM Sunnyvale Meetup.pdfACM Sunnyvale Meetup.pdf
ACM Sunnyvale Meetup.pdfAnyscale
 
Overview Of .Net 4.0 Sanjay Vyas
Overview Of .Net 4.0   Sanjay VyasOverview Of .Net 4.0   Sanjay Vyas
Overview Of .Net 4.0 Sanjay Vyasrsnarayanan
 
Profiling Multicore Systems to Maximize Core Utilization
Profiling Multicore Systems to Maximize Core Utilization Profiling Multicore Systems to Maximize Core Utilization
Profiling Multicore Systems to Maximize Core Utilization mentoresd
 
C# Parallel programming
C# Parallel programmingC# Parallel programming
C# Parallel programmingUmeshwaran V
 
Att lyckas med integration av arbetet från flera scrum team - Christophe Acho...
Att lyckas med integration av arbetet från flera scrum team - Christophe Acho...Att lyckas med integration av arbetet från flera scrum team - Christophe Acho...
Att lyckas med integration av arbetet från flera scrum team - Christophe Acho...manssandstrom
 
Reverse Engineering of Software Architecture
Reverse Engineering of Software ArchitectureReverse Engineering of Software Architecture
Reverse Engineering of Software ArchitectureDharmalingam Ganesan
 

Ähnlich wie Parallel Programming in .NET (20)

Tim - FSharp
Tim - FSharpTim - FSharp
Tim - FSharp
 
Overall 23 11_2007_hdp
Overall 23 11_2007_hdpOverall 23 11_2007_hdp
Overall 23 11_2007_hdp
 
Thinking in parallel ab tuladev
Thinking in parallel ab tuladevThinking in parallel ab tuladev
Thinking in parallel ab tuladev
 
GPars: Groovy Parallelism for Java
GPars: Groovy Parallelism for JavaGPars: Groovy Parallelism for Java
GPars: Groovy Parallelism for Java
 
(ATS3-PLAT06) Handling “Big Data” with Pipeline Pilot (MapReduce/NoSQL)
(ATS3-PLAT06) Handling “Big Data” with Pipeline Pilot (MapReduce/NoSQL)(ATS3-PLAT06) Handling “Big Data” with Pipeline Pilot (MapReduce/NoSQL)
(ATS3-PLAT06) Handling “Big Data” with Pipeline Pilot (MapReduce/NoSQL)
 
CH03.ppt dsqdDQWDQWDQWDWDQDQDQWDQQDDQDWDQWQ
CH03.ppt dsqdDQWDQWDQWDWDQDQDQWDQQDDQDWDQWQCH03.ppt dsqdDQWDQWDQWDWDQDQDQWDQQDDQDWDQWQ
CH03.ppt dsqdDQWDQWDQWDWDQDQDQWDQQDDQDWDQWQ
 
LINQ/PLINQ
LINQ/PLINQLINQ/PLINQ
LINQ/PLINQ
 
Multi core programming 1
Multi core programming 1Multi core programming 1
Multi core programming 1
 
VTU 6th Sem Elective CSE - Module 3 cloud computing
VTU 6th Sem Elective CSE - Module 3 cloud computingVTU 6th Sem Elective CSE - Module 3 cloud computing
VTU 6th Sem Elective CSE - Module 3 cloud computing
 
Concurrency Programming in Java - 01 - Introduction to Concurrency Programming
Concurrency Programming in Java - 01 - Introduction to Concurrency ProgrammingConcurrency Programming in Java - 01 - Introduction to Concurrency Programming
Concurrency Programming in Java - 01 - Introduction to Concurrency Programming
 
MEW22 22nd Machine Evaluation Workshop Microsoft
MEW22 22nd Machine Evaluation Workshop MicrosoftMEW22 22nd Machine Evaluation Workshop Microsoft
MEW22 22nd Machine Evaluation Workshop Microsoft
 
WORKS 11 Presentation
WORKS 11 PresentationWORKS 11 Presentation
WORKS 11 Presentation
 
ACM Sunnyvale Meetup.pdf
ACM Sunnyvale Meetup.pdfACM Sunnyvale Meetup.pdf
ACM Sunnyvale Meetup.pdf
 
Overview Of .Net 4.0 Sanjay Vyas
Overview Of .Net 4.0   Sanjay VyasOverview Of .Net 4.0   Sanjay Vyas
Overview Of .Net 4.0 Sanjay Vyas
 
Profiling Multicore Systems to Maximize Core Utilization
Profiling Multicore Systems to Maximize Core Utilization Profiling Multicore Systems to Maximize Core Utilization
Profiling Multicore Systems to Maximize Core Utilization
 
C# Parallel programming
C# Parallel programmingC# Parallel programming
C# Parallel programming
 
Att lyckas med integration av arbetet från flera scrum team - Christophe Acho...
Att lyckas med integration av arbetet från flera scrum team - Christophe Acho...Att lyckas med integration av arbetet från flera scrum team - Christophe Acho...
Att lyckas med integration av arbetet från flera scrum team - Christophe Acho...
 
Java1
Java1Java1
Java1
 
Java
Java Java
Java
 
Reverse Engineering of Software Architecture
Reverse Engineering of Software ArchitectureReverse Engineering of Software Architecture
Reverse Engineering of Software Architecture
 

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
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbuapidays
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
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
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
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
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
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
 
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
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
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
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 

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 ...
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
+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...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
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
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
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
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
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
 
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
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
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
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 

Parallel Programming in .NET

  • 2.  Concurrency  Parallel Programming  Parallel Extensions in .NET 4.0  Coordination Data Structures  Task Parallelism  Parallel Loop /Data Parallelism  Parallel LINQ
  • 4. • Perform multiple Program A Program B computations What in overlapping time Step 1 T periods Step1 I Step2 M E • Responsive UI Step2 • Asynchronous Why Processing Step3 Step3 • Better performance(??) Concurrency is almost everywhere….. OS,Database,Web Servers,GUI programs, File processing….
  • 5. Program Concurrent Concurrent Concurrent Component 1 Component 2 Component N Read/Write Shared Memory Shared Memory Model of Concurrency
  • 6. OS Process Thread 1 Thread 2 Thread N Read/Write Shared Memory Operating System View
  • 7. Managed Program in CLR App Domain Managed Managed Managed Thread 1 Thread 2 Thread N Read/Write Shared Memory .NET Common Language Runtime View
  • 8. Create ThreadStart delegate with the method to be executed Create instance of Thread class with the ThreadStart delegate Start the thread execution
  • 9.  Synchronization Issues  Race Condition  Deadlock  Dependency on Memory Model & Hardware Architecture  Debugging becomes complicated
  • 10. Demo1
  • 11. Run Suspend Thread1 Thread1 Suspend Thread2 Thread2 Run Single Core Program Processor
  • 12. Run Thread1 Thread1 Core1 Run Thread2 Thread2 Core2 Program Multi Core Processor Concurrency - Perform multiple computations in overlapping time periods Parallel - Perform multiple computations simultaneously
  • 14.  No more increase in clock speed  Increase in number of processors  Sequential programs won’t scale  Parallel Programming  To leverage hardware advances Source: PDC 09 Patterns of Parallel Programming Workshop
  • 15.  Decompose the program into parts e.g. methods, statements etc.  Identify the parts which can be executed in parallel  Assign each part to separate tasks  Perform the tasks in parallel on different cores  Each task is likely to perform different actions
  • 16.  Partition the input data into multiple chunks  Perform action on each chunk in parallel on different cores  Merge the output results  Can be scaled up with more processors as data volume grows
  • 17. To develop applications for the multicore processors we need  Design  Identify parallel parts  Apply correct design patterns  Libraries  Sophisticated synchronization features to avoid deadlocks/race etc.  Thread safe data structures & containers  Language/API support for common parallel programming patterns to achieve task/data parallelism.  Tools  For debugging parallel applications  For profiling parallel applications Parallel Extensions in .NET 4.0
  • 19. Integrated Programming Models Programming Models Tooling PLINQ Parallel Task Parallel Parallel Pattern Agents Debugger Library Library Library Toolwindows Data Structures Data Structures Concurrency Runtime Concurrency Runtime ThreadPool Profiler Task Scheduler Concurrency Task Scheduler Analysis Resource Manager Resource Manager Operating System Threads Key: Managed Library Native Library Tools Source: PDC 08 Daniel Moth’s Presentation
  • 20. Thread-safe collections Phased Operation ConcurrentStack<T> ConcurrentQueue<T> ConcurrentDictionary<TKey,TValue> Locks Work exchange BlockingCollection<T> IProducerConsumerCollection<T> Initialization LazyInit<T> Source: PDC 08 Daniel Moth’s Presentation
  • 21. Demo2
  • 22. Demo3
  • 23. APIs provided under System.Threading & Sytem.Threading.Tasks  Behind the scenes uses CLR Thread Pool  Uses sophisticated algorithms to assign number of threads to maximize performance  More programmatic control than thread or work item  Create/Start Tasks  Return result values from tasks  Chain Multiple Tasks  Nested & Child Tasks  Exception Handling
  • 24. Constructor - public Task( Action action ) Action delegate - public delegate void Action() Lambda Expression without input parameter and returning nothing Create an explicit instance of Action delegate and pass it to task constructor Start the Tasks
  • 25. Class: public class Task<TResult> : Task Constructor: public Task( Func<TResult> function ) Delegate: public delegate TResult Func<out TResult>() Lambda Expression without input parameter and returning int Create new instance of Func delegate with no input parameter and returning int We have instantiated & started two tasks which expected to return integer value The property Result stores the return value
  • 26. Class: public Task ContinueWith( Action<Task> continuationAction ) Instantiate a Task with Action delegate Create an Action delegate with a task object as input and returning nothing. Call ContinueWith method and pass the Action delegate created Start the Task. After this task completes it will Continue With the execution of Action a2 automatically
  • 27. This is a lambda expression and Task t1 will execute this statements Task t11 is created while Task T1 is executing. This is a Nested Task Task t12 is created while Task T1 is executing but with AttachedToParent option. This is a Child Task. Child tasks are very closely synchronized with the parent
  • 28. Demo4
  • 29. Method : public static void Invoke( params Action[] actions ) Three Action delegates are created Three Action delegates will be invoked possibly in Parallel
  • 30. Demo5
  • 31. Method : public static ParallelLoopResult For( int fromInclusive, int toExclusive, Action<int> body ) Upper & Lower Bounds of the For Loop Loop Counter Statement executed in the loop When a For() loop has a small body, it might perform more slowly Slower performance is caused by the overhead involved in partitioning the data and the cost of invoking a delegate on each loop iteration.
  • 32. Method : public static ParallelLoopResult ForEach<TSource>( IEnumerable<TSource> source, Action<TSource> body ) Int Array with values from 0 to 100000 Loop iteration variable Loop Body
  • 33. Demo6
  • 34. Language-Integrated Query (LINQ) was introduced in the .NET Framework version 3.0  Querying on any System.Collections.IEnumerable or System.Collections.Generic.IEnumerable data source  Parallel LINQ (PLINQ) is a parallel implementation of the LINQ pattern  PLINQ tries to make full use of all the processors on the system  Partitions the data source into segments  Executes the query on each segment on separate worker threads in parallel on multiple processors
  • 35. Method : public static ParallelQuery<TSource> AsParallel<TSource>( this IEnumerable<TSource> source ) Method : public static void ForAll<TSource>( this ParallelQuery<TSource> source, Action<TSource> action ) Instructs to execute the LINQ query in Parallel Invokes in parallel the specified action for each element in the source.
  • 36. Demo7
  • 37. PLINQ, the goal is to maximize performance while maintaining correctness  In some cases, correctness requires the order of the source sequence to be preserved  Ordering can be computationally expensive  PLINQ by default does not preserve the order of the source sequence  To turn on order-preservation the AsOrdered operator is to be used on the source sequence
  • 38. Method : public static ParallelQuery AsOrdered( this ParallelQuery source ) Instructs to execute the LINQ query in Parallel by preserving order
  • 39. Demo8
  • 41. http://msdn.microsoft.com/en-us/library/dd460693.aspx http://channel9.msdn.com/pdc2008/TL26/ http://www.ademiller.com/blogs/tech/2009/11/pdc-patterns- of-parallel-programming-workshop/ Concurrent Programming on Windows by Joe Duffy
  • 43. This is like a pointer to function which accepts nothing and returns nothing Accepts delegate D as input M2 has no parameter & return value An instance of delegate D or a pointer to method M2 Call to M1 with delegate instance d1 as a parameter. Call to M1 with Lambda Expression Lambda Expression is an anonymous method (input parameters) => (statement)