Bqovamjlqmmojgt77dtd

C# Async Architect

Learn how to write robust multi-threaded C# code that can take a beating.

In 2004, the Dutch innovation center MediaPlaza invited me to join them to build a supermarket shelf for the Shop Of The Future.

The shelf had built-in RFID antennas and could automatically detect when products where placed on or taken off the shelf. We also added LCD displays with dynamic pricing and monitors to display context-aware commercials. It looked like this:

I wrote all of the multi-threaded C# code to drive the RFID antennas and automatically detect when groceries fitted with an RFID tags were placed on the shelves.

The shelf was very popular with crowds, but it had a flaw: the code occasionally crashed during initialization. We managed to temporarily work around the problem by rebooting the shelf a couple of times. Eventually it would start up and work normally.

I tracked the problem down and found an issue with the Windows driver for the RFID antenna. Even though the vendor swore that his driver was completely thread-safe, I managed to crash it repeatedly by calling its initialization method simultaneously on two threads.

So this was obviously some kind of race condition inside the driver. The fix was simple - all I had to do is make the initialization a critical section by running my initialization code inside a lock statement.

If the words in bold are all Greek to you, then this is the course for you!

Writing multi-threaded code is pretty hard. The sobering truth is that if you do not know what you're doing, your code is pretty much guaranteed to crash spectacularly in production. But 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.


"This is an excellent resource on multi-threading"

- Gary Jarvis, course student

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 the section you will be able to write robust multi-threaded C# code that can take a beating.

Then we'll move on - 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 using Threads, the Tasks Parallel Library, and Parallel LINQ.

Class Curriculum



Frequently Asked Questions


When does the course start and finish?
The course starts when you enroll and never ends. It is a self-paced online course, so you decide when you start and when you finish.
How long will I have access to the course?
That depends. If you take a subscription you'll have access to everything for as long as your subscription is active. If you purchase the course you'll have lifetime access, but only to this course.
What if I want a refund?
I'm happy to issue a full refund within the first 30 days.
What skills will this course teach me?
This course will teach you how to write robust and bulletproof multi-threaded code using threads, tasks, and parallel LINQ expressions. You'll also learn how to avoid deadlocks, livelocks, race conditions, and much more.
Will this course help me grow in my career?
Yes! I created this course to teach developers the exact kind of skills I want to see in the people I work with.
What equipment/tools will I need to complete the course?
A computer with the .NET Framework installed, and your favourite IDE (I use Visual Studio Community Edition for OS/X)
Will I get access to the full course all at once?
Yes. You can go through the curriculum in any order you like.
Where is this course hosted?
This course is hosted on Teachable, a well-known and respected educational technology company. Teachable provides a social online learning platform and is based in New York.
What do I do if I need help?
If you need help with something related to the course, please contact me at mark@mdfarragher.com. Thanks!

Get started now!



 

Subscribe to all of my courses, and get automatic access to any new course I produce for only $19 / month. More...