1 / 18

Aplikacje równoległe są dla każdego

Aplikacje równoległe są dla każdego. Paweł Łukasik Wroc.NET. mail: lukasik.pawel@gmail.com Twitter : @ pawel_lukasik. AGENDA. Po co nam coś nowego? ThreadPool w .NET 4 Data parallelism Task parallelism Nowe klasy „zsynchronizowane” Narzędzia. Po co nam coś nowego?.

luce
Télécharger la présentation

Aplikacje równoległe są dla każdego

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Aplikacje równoległe są dla każdego Paweł Łukasik Wroc.NET mail: lukasik.pawel@gmail.com Twitter: @pawel_lukasik

  2. AGENDA • Po co nam coś nowego? • ThreadPool w .NET 4 • Data parallelism • Taskparallelism • Nowe klasy „zsynchronizowane” • Narzędzia

  3. Po co nam coś nowego? The purpose of the TPL is to make developers more productive by simplifying the process of adding parallelism and concurrency to applications. The TPL scales the degree of concurrency dynamically to most efficiently use all the processors that are available. In addition, the TPL handles the partitioning of the work, the scheduling of threads on the ThreadPool, cancellation support, state management, and other low-level details. By using TPL, you can maximize the performance of your code while focusing on the work that your program is designed to accomplish.  • Abstrakcja • Spójne API • Uproszczone użycie • Dynamiczne zrównoleglenie • Anulowanie zadań • Stany wątków A wszystko to tylko w jednym celu….

  4. ThreadPool – Co nowego? • Zmiana wewnętrznego działania – mniej blokowania • Wykradanie zadań (work-stealing) • Szybszy - od 2x (na Dual) do 5,6x (na Quad)

  5. Global queue T1 T2 T3 Thread 1 Thread 2

  6. DEMO – Data parallelism

  7. Podsumowanie • Użycie • ParallelOptions • Anulowanie • Różne strategie wyjścia (tzw. EarlyTermination) • Partitioner • Local state

  8. DEMO - Taskparallelism

  9. TPL - podsumowanie • Sposób użycia • TaskCreationOptions (PreferFairness, AttachToParent, LongRunning) • TaskContinuationOptions (NotOn…, OnlyOn) • Scheduler • Anulowanie

  10. DEMO - Parallel LINQ

  11. PLINQ - Podsumowanie • .AsParallel, ParallelEnumerable • WithDegreeOfParallelism • WithExecutionMode • WithMergeOptions • WithCancellation

  12. DEMO – Concurrentclasses

  13. Podsumowanie – Concurrentclasses • Thread-safe • BlockingCollection • ConcurrentQueue

  14. DEMO – Debuggingtools

  15. DebuggingTools - Podsumowanie • Pozwalają w łatwiejszy sposób przyjrzeć się naszej aplikacji • Śledzenie tasków (ParallelTasks) • Obrazowanie zależności (ParallelStacks) • Wydajność (Performance Analysis)

  16. Pytania?

  17. Źródła • http://msdn.microsoft.com/en-gb/concurrency/default.aspx • http://blogs.msdn.com/pfxteam/default.aspx • http://code.msdn.microsoft.com/ParExtSamples • http://blogs.msdn.com/pfxteam/archive/2010/04/21/9997559.aspx • Axum - http://msdn.microsoft.com/en-us/devlabs/dd795202.aspx

  18. Dziękuję za uwagę Pytania?

More Related