Udemy
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    •  
Turn what you know into an opportunity and reach millions around the world.
Learn More
Your cart is empty.
Keep shopping
How To Write Bulletproof Multi-Threaded C# Code
Rating: 4.5 out of 5(1,410 ratings)
11,106 students

How To Write Bulletproof Multi-Threaded C# Code

This course teaches you how to write robust multi-threaded C# code. A skill every professional .NET developer must know
Created byMark Farragher
Last updated 5/2026
English

What you'll learn

  • Learn to write multi-threaded code
  • Safely abort a thread
  • How can two or more threads exchange data?
  • The main reasons why multi-threaded code crashes
  • Learn to resolve race conditions
  • Use AutoResetEvent and ManualResetEvent in your code
  • The Dining Philosopher problem
  • Line up threads with the Barrier class
  • ... and much more!

Course content

5 sections28 lectures2h 59m total length
  • Course Introduction4:07

    In this lecture I explain how this course is organised and I describe each of the upcoming sections in detail.

  • Introduction To Threading4:25

    In this lecture we're going to look at the theory behind asynchronous programming. What exactly is multithreaded code, and how does it work?

  • Windows, OS/X or Linux?3:19

    Many lectures in this course contain source code examples. Feel free to download the code and follow along. And here's the good news: it doesn't matter if you have a Window, Mac or Linux computer. The code will run on all three operating systems.

    In this lecture I demonstrate how my solutions and projects run on all operating systems. I will show you how to build and run the source code on a Mac, on Linux and in Visual Studio running on Windows 8.

    At the end of this lecture you will have learned that .NET code is portable and can run on at least five different operating systems.

  • Background Info - About Me1:14

Requirements

  • You need a Windows, Mac or Linux laptop with Microsoft Visual Studio, Xamarin Studio or Monodevelop
  • You should be a beginner, intermediate, or advanced C# developer
  • That's it!

Description

Do you know how to write robust multi-threaded C# code that does not crash?

Lets face it: writing multi-threaded code is hard. The sobering truth is that, unless you know exactly what you're doing, your code is pretty much guaranteed to crash in production.

Don't let this happen to you!

It doesn't have to be like this. If you have a good understanding of multi-threaded programming and follow a few simple industry best practices, you can write robust code that can take a beating.

I wrote a multi-threaded conversion utility a few years ago, that successfully migrated 100,000 documents from SharePoint 2010 to SharePoint 2013. The program worked flawlessly the first time, because I implemented all of the best practices for writing asynchronous C# code.

Sound good?

In this course I am going to share these practices with you.

In a series of short lectures I will cover many multi-threading topics. I will show you all of the problems you can expect in asynchronous code, like race conditions, deadlocks, livelocks and synchronisation issues. I'll show you quick and easy strategies to resolve these problems.

By the end of this course you will be able to write robust multi-threaded C# code that can take a beating.

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. Asynchronous programming 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 section of code in a multi-threaded C# project, and need to make sure your code is rock-solid in production? 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 threading-related questions they might throw at you.

Who this course is for:

  • Beginner, intermediate, and advanced C# programmers who want to learn how to write bulletproof multi-threaded C# code
  • Developers who are about to take a job interview and need to prepare for threading-related questions
  • Professionals who are writing a section of multi-threaded code in a large C# project