Introduction to C# Threading
Are you a C# developer and want to take your multi-threading skills to the next level? Are you working on a critical section of code and need to make sure your multi-threaded code is rock-solid in production? Or are you preparing for a C# exam?
Then this is the course for you! The tips and tricks in this course will give you an excellent foundation to start writing your very own bulletproof multi-threaded code.
The course covers threads, starting and aborting threads, locking threads, deadlocks, synchronizing threads, the AutoResetEvent and friends, and the thread barrier class. All you need to know to write your own robust multi-threaded code that will just keep running and never fail on you in production.
Here’s What You’ll Get
C# Code Examples
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.
Content: training lectures, video lessons, and quizzes
Requirements: a Windows, Mac or Linux laptop with Visual Studio Code and the NET Framework
Support: Slack channel.
Associated certification: none.
In this complimentary training lecture, I will teach you how to synchronize two threads by using the special AutoResetEvent class in C#. This class allows two threads to safely exchange data without risking a race condition or a deadlock.
Introduction to Threading
Windows, OS/X or Linux?
Working with Threads
How to Start a Thread
First Problem: Race Conditions
Passing In Data to a Thread
Second Problem: Waiting On a Thread
Joining and Suspending Threads
Interrupting and Aborting Threads
Introducing Thread Locking
When Should You Lock Threads?
The Lock Statement
Dealing With Deadlocks
Assignment: Have Dinner With The Philosophers
Using The Interlocked Class
How to Synchronize Thread
Thread Synchronization With AutoResetEvents
How to Build a Producer/Consumer Queue
The ManualResetEvent Class
The CountdownEvent Class
Sign Up For This Training
Once we have received your payment, you will receive an email within minutes with a link to access the online training platform.
Please note that the listed price is ex VAT. Registered EU businesses with a valid VAT number can defer the VAT during checkout. Non-EU businesses and individuals do not pay VAT.
Looking For Something Else?
Vikram Hegde, online student
See Me In Action
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 antenna’s 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 narrowcasting commercials and showing live stock levels.
I wrote the multi-threaded C# code that drove the RFID antenna’s, 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 my software at a trade show in Utrecht.
Frequently Asked Questions
- Classroom Training
- Microsoft Training
- Online Training