Advanced Threading in C#

Advanced Threading in C#

2h 9mIntermediate2018-04-02

Authors

Chander Dhall

Chander Dhall

Microsoft MVP, Consultant

Course details

Learn how to write C# applications that perform multiple tasks concurrently-aka multithreaded applications. Programs that use multithreading are more responsive to user input because the user interface stays active as processor-intensive tasks execute on separate threads. Multithreading is also useful when you create scalable applications because you can add threads as the workload increases. In this course, Microsoft MVP Chander Dhall reviews the basics of threading and signaling, and then shows how to use the popular .NET library for parallel execution, TPL; the query syntax PLINQ; and the recommended asynchronous programming pattern, TAP. By the end of the course, he shows how to turn sequential code into a multithreaded application that runs five times faster than before.

Learning objectives
Thread safety and affinity
Signaling
Task Parallel Library (TPL) basics
PLINQ introduction
Task-based Asynchronous Pattern (TAP)

Skills covered

C#PersonaProgramming LanguagesMicrosoftSoftware Development

Concepts

Introduction

  • Welcome
  • What you should know

Signaling and Thread Concepts

  • Thread safety
  • Thread affinity
  • Signaling - AutoResetEvent
  • Two-way signaling
  • Signaling - ManualResetEvent
  • Signaling - Countdown

Task Parallel Library (TPL)

  • TPL introduction
  • TPL demo
  • Parallel vs. normal execution
  • Parallel.For with thread local
  • Continuation with state
  • TaskCompletionSource

PLINQ

  • PLINQ introduction
  • PLINQ demo
  • Degree of parallelism
  • Concurrency bag
  • Merge options

Task Asynchronous Pattern (TAP)

  • TAP introduction
  • TAP demo

Conclusion

  • Next steps
80,000 Toman