Presentation is loading. Please wait.

Presentation is loading. Please wait.

An overview of… Luis Guerrero Plain Concepts

Similar presentations


Presentation on theme: "An overview of… Luis Guerrero Plain Concepts"— Presentation transcript:

1 An overview of… Luis Guerrero Plain Concepts http://www.luisguerrero.net http://geeks.ms/blogs/luisguerrero/

2

3

4  Finding exploitable parallelism  Organizing by Tasks  Organizing by Data  Organizing by Ordering

5  Linear or recursive?  Task parallel  Divide and conquer  Enough task?  Too many – thrashing  Too few – under utilization  Dependencies between tasks  Scheduling work to tasks {}

6  Work per task?  Small workloads  Variable workloads  Dependencies between tasks?  Removable  Separable  Read only or read/write {}

7  Linear or recursive?  Geometric decomposition  Recursive data  Data “chunk” size?  Too big – under utilization  Too small – trashing  Chunk layout?  Cache and cache line size  False cache sharing {}

8  Implementation Patterns  Fork / Join  Loop Parallel  Divide and Conquer  Producer / Consumer  Pipeline  Asynchronous Agents

9  Task Parallel Library  Parallel LINQ (PLINQ)  Data Structures for Parallel Programming  Parallel Diagnostic Tools

10  Data parallelism: The Parallel Class  Parallel  For  For<>  Foreach  Invoke

11 Parallel class

12  Task is the minimum unit of work in TPL  Can be scheduled by request  2 Scheduled inside.NET box, ThreadPool y UI  Can have a result  Is observable  Can be continue with another task  Can be securely cancelled  Someone can wait for a completion

13 Creating Tasks

14 Task continuation

15 Exceptions and cancellation support

16 A Barrier is a synchronization primitive that enforces the stopping of execution between a number of threads or processes at a given point and prevents further execution until all threads or processors have reached the given point. A CountdownEvent is a synchronization primitive that enables ongoing tracking of a given workload in order to determine if processing of that workload is finished or not.

17 Barrier y CountdownEvent

18 PLINQ

19 An introduction to….

20 The Managed Extensibility Framework (MEF) is a new library in.NET 4 for building applications that can be incrementally extended.  For customers  For you and your team  Always there, always ready

21 The Managed Extensibility Framework (MEF) is a new library in the.NET Framework that enables greater reuse of applications and components. Using MEF,.NET applications can make the shift from being statically compiled to dynamically composed

22 In software engineering, extensibility is a systemic measure of the ability to extend a system and the level of effort required to implement the extension.

23 Software entities should be open for extension, but closed for modification.

24 KnownUnknown VS.

25  An Application is built of parts.

26  Export it.  Import it.  Compose it.

27 Widget1 [Export(typeof(UserControl))] public class Widget1 : UserControl { public string Message { get{return(string) Button.Content;} set{Button.Content=value;} } Export

28 Widget1 [Export(typeof(UserControl))] public class Widget1 : UserControl { [Import] public string Message { get{return(string) Button.Content;} set{Button.Content=value;} } Import

29 Widget1 [Export(typeof(UserControl))] public class Widget1 : UserControl { [Import(“HelloMEF.Message”)] public string Message { get{return(string) Button.Content;} set{Button.Content=value;} } Import

30 Main Page [Export(typeof(UserControl))] public class MainPage: UserControl { [ImportMany(typeof(UserControl))] public IEnumerable { get;set; } ImportMany

31 PartIntializer: “Compose yourself” Main Page Compose public MainPage() { InitializeComponent(); PartInitializer.SatisfyImports(this); }

32

33 Widget1 [ExportMetadata(“Location”,Location.Top)] [Export(typeof(UserControl))] public class Widget1 : UserControl { public string Message { get{return(string) Button.Content;} set{Button.Content=value;} } Export

34 Main Page [Export(typeof(UserControl))] public class MainPage: UserControl { [ImportMany(typeof(UserControl))] public IEnumerable { get;set; } ImportMany

35 Widget1 [ExportMetadata(“Location”,Location.Top)] [Export(typeof(UserControl))] public class Widget1 : UserControl { public string Message { get{return(string) Button.Content;} set{Button.Content=value;} } Export

36 Widget1 [Widget(Location=Location.Top)] public class Widget1 : UserControl { public string Message { get{return(string) Button.Content;} set{Button.Content=value;} } Export

37 Container

38 Catalog

39 Container Catalog TypeCatalog AssemblyCatalog DirectoryCatalog AggregatingCatalog

40 Part B Export Export [Import(typeof(ILogger))] public ILogger Export Logger { get; set; }

41 Container Part A Part B [CompositionOptions(CreationPolicy=CreationPolicy.NonShared)] [CompositionOptions(CreationPolicy=CreationPolicy.Shared)] Shared Non-Shared On Export [Import(RequiredCreationPolicy=CreationPolicy.NonShared)] [Import(RequiredCreationPolicy=CreationPolicy.Shared)] On Import


Download ppt "An overview of… Luis Guerrero Plain Concepts"

Similar presentations


Ads by Google