MDFT Academy/Write Multithreaded C# Code

  • €95

Write Multithreaded C# Code

The threading topics in this course will give you an excellent foundation to start writing your own multi-threaded code. The course covers starting and aborting threads, locking threads, synchronizing threads, dealing with deadlocks and livelocks, auto-reset events and the thread barrier class. All you need to make your next multi-threaded code completely bulletproof.

Here's What You'll Get

29

Lessons

26

Videos

3

Quizzes

13

Threading Examples

This course contains a series of short lectures that cover many fundamental multithreading topics. I’ll show you all the problems you can expect in asynchronous code, like race conditions, deadlocks, livelocks and synchronisation issues. I’ll teach you quick and easy strategies to resolve these problems.

You will learn to write multithreaded code, how to safely start and abort a thread, and how to exchange data between two or more threads. I’ll explain the main reasons why multithreaded code often crashes, and what you can do about it. We’ll also look at resolving race conditions, using the AutoResetEvent and ManualResetEvent in code… and much more!

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

The training covers the following topics:

Introduction to Threading

The Thread Class

Starting Threads

Background and Foreground Threads

Race Conditions

Initializing Thread

Waiting for a Thread

Joining Threads

Suspending Threads

Interrupting Threads

Aborting Threads

Locking Threads

The Lock Statement

The Dining Philosophers

Deadlocks

Livelocks

The Interlocked Class

Thread Synchronization

The AutoResetEvent Class

The Set and WaitOne Methods

Safe Handover with 2 AutoResetEvents

Producer/Consumer Queues

The ManualResetEvent Class 

The CountdownEvent Class

Thread Rendezvous


Lesson Preview

Check out this training lesson preview in which I will show you the Dining Philosopher problem, a well-known thought experiment that deals with deadlocks and livelocks and teaches you how to build a thread scheduler.

The video covers Deadlocks, Livelocks, Resource Contention and the Dining Philosopher problem.

Featured Topics

Here are four threading topic slides from the training. You can apply these techniques to any C# code to create a robust and correct multi-threaded application.

Locking Threads

Threads can be locked to set up a critical section in which no other thread can access fields and variables.

AutoResetEvent

The AutoResetEvent is a thread synchronization object that can be used to synchronize data exchange between threads.

Thread Synchronization

Exchanging data between two threads is a complex challenge that requires two AutoResetEvents.

Producer Consumer Queues

Producer consumer queues are usefull data structures that simplify exchanging data between threads.

What You'll Need

For this course you will need a computer (running Windows, MacOS, or Linux), Microsoft Visual Studio Code, and the NET Core SDK.

Buy This Course

Choose the plan that works best for you. Buy this course and dive into C# multithreading, or unlock unlimited access to every course on the site.

Want the best learning experience?
Members get access to the full course library, all labs and community pages, receive priority support and sneak previews of future course releases.

Prices shown exclude VAT. EU businesses can defer VAT during checkout with a valid VAT ID number.

Buy This Course

Buy this course and get lifetime access to all lectures and knowledge quizzes

✔️ This course
✔️ Included quizzes only
✔️ Included labs only
🚫 No priority support
🚫 No community access
🚫 No future courses

€95 one time

Get A Membership

Get access to all courses, lectures, labs, quizzes, and future releases

✔️ All courses
✔️ All quizzes
✔️ All labs
✔️ Priority support
✔️ Community pages
✔️ Access to future courses

€35 p/mo or €350 p/yr

Team Training

In-company or online team training with guided labs and live support

🪙 Onsite or online
🪙 Conducted live
🪙 For teams of 5-12
🪙 3-day training
🪙 Guided labs
🪙 Can be customized

€1250 p/day

Training Curriculum

Introduction

Course Introduction
Introduction To Threading
Windows, OS/X or Linux?

Working With Threads

Section Introduction
How To Start A Thread
Preview
First Problem: Race Conditions
Preview
Passing In Data To A Thread
Preview
Second Problem: Waiting On A Thread
Joining And Suspending Threads
Interrupting And Aborting Threads
Section Recap
Quiz 1: Working with threads

Introducing Thread Locking

Section Introduction
When Should You Lock Threads?
The Lock Statement
Dealing With Deadlocks
Assignment: Have Dinner With The Philosophers
Using The Interlocked Class
Section Recap
Quiz 2: Thread Locking

How To Synchronize Threads

Section Introduction
Thread Synchronization With AutoResetEvents
How To Build A Producer/Consumer Queue
The ManualResetEvent Class
The CountdownEvent Class
Thread Rendezvous
Section Recap
Quiz 3: Thread Synchronization

Final Words

Course Recap

What My Students Are Saying

Your examples using turnstiles are exemplary. You have managed to explain a concept that takes people years to master. The code examples were an absolute joy to work with and adding them into my pet projects was amazingly easy.

Barend van der Merwe

This course has enabled me to implement and utilize threading to make my C# programs a lot more efficient. This course is well worth the money!! Fantastic Course!! Fantastic Lecturer!! Highly Recommended!!

Scott Wilson

Still Got Questions?

I hope I've given you a clear overview of the contents of this training course. But if anything is still unclear and you have some unanswered questions, then please check out this FAQ section

What is an online training?

In an online training you can study the training lectures and work on the homework assignments in your own time and at your own pace. You can spend as many or as little hours per week as you want on the training.

What's included?

You will receive prerecorded online video lectures, text lectures, multiple-choice quizzes and homework exercises.

How am I supported?

You are supported through email, and you can also book a 30-minute video support call with me if you want. I will help you with the training lectures and homework projects and get you ready for your certification exams.

Who should attend?

An online training is ideal for tech professionals who want to set their own learning pace and prefer to work independently with a bit of guidance and support throughout the training.

Where is the training hosted?

I host all my training content on Podia, a well-known e-learning platform based in the United States.

How long do I have access?

You have unlimited access to the online training content and your login account will never expire.

Can you train my entire team?

Yes! I often host classroom trainings where I teach tech subjects to an entire business team. Contact me and we'll get it organised.

See Me In Action

BUILDING THE SUPERMARKET OF THE FUTURE FOR MEDIAPLAZA

In 2005 the Dutch innovation center MediaPlaza invited me to help them build the supermarket shelf of the future. We created a cabinet with hidden RFID antennas that automatically detected when products tagged with RFID chips were placed on or picked up from the shelves. We also added LCD displays showing dynamic prices and TV monitors for playing commercials and showing stock levels.

I wrote the multi-threaded C# code that drove the RFID antennas, detected products entering or leaving the antenna fields, updated the prices on the LCD displays, played commercials and updated the stock levels automatically. The photo shows the finished product running at a trade show in Utrecht.

Would You Like To Know More?

Sign up for the newsletter and get notified when I publish new posts and articles online.
Let's stay in touch!

You're signing up to receive emails from MDFT Academy