How To Write Asynchronous C# Code With Tasks and PLINQ

Mark Farragher, Microsoft Certified Trainer

Play Speed
  • 0.5x
  • 1x (Normal)
  • 1.25x
  • 1.5x
  • 2x
19 Videos (2h 44m)
    • Course Introduction

    • About this course

    • Introducing TPL and PLINQ

    • How to start a thread

    • Race conditions

    • Resolve race conditions with thread locking

    • The lock statement

    • Thread synchronisation with AutoResetEvents

    • How to start a task

    • Working with tasks

    • Initialising and cancelling tasks

    • Parent and child tasks

    • Task continuations

    • When should you use tasks?

    • When should you use PLINQ?

    • Word reversal with PLINQ

    • PLINQ and item ordering

    • Limitations of PLINQ

    • Course recap


About This Class


Today we have beautiful libraries for writing multi-threaded C#, and there is simply no excuse for writing bad asynchronous code. In this course I will teach you how to write rock-solid code using Tasks and Parallel LINQ that works perfectly on your first try.

I wrote a multi-threaded conversion utility a year ago that successfully migrated 100,000 documents from SharePoint 2010 to SharePoint 2013. The program worked flawlessly the first time because I used PLINQ.

Sound good?

Writing multi-threaded code by hand is hard. I’ll prove it to you by showing you some code that exchanges data between two threads. You will be surprised how difficult it is to do this reliably.

But then I’ll show you how trivially easy it is to write asynchronous C# code using the Task Parallel Library and Parallel LINQ. These amazing frameworks allow anyone to write robust multi-threaded code that can take a beating.

By the end of the course you will be fluent in both the Tasks Parallel Library and Parallel LINQ.

Why should you take this course?

You should take this course if you are a beginner or intermediate C# developer and want to take your skills to the next level. Working with Tasks and Parallel LINQ might sound complicated, but all of my lectures are very easy to follow, and I explain all topics with clear code and many instructive diagrams. You'll have no trouble following along.

Or maybe you're working on a critical asynchronous section of C# code in a lage project, and need to make sure your code scales reliably over multiple CPU cores? The tips and tricks in this course will help you immensely.

Or maybe you're preparing for a C# related job interview? This course will give you an excellent foundation to answer any asynchronous programming questions they might throw at you.






Reviews (0)

Mark Farragher

Microsoft Certified Trainer

Mark Farragher is a blogger, investor, serial entrepreneur, and the author of 11 successful Udemy courses. He has been a Founder and CTO, and has launched two startups in the Netherlands. Mark became a Microsoft Certified Trainer in 2005. Today he uses his extensive knowledge to help tech professionals with their leadership, communication, and technical skills.

See full profile

Technology Mobile Development Csharp