Advanced C# multithreading with Task synchronization

preview_player
Показать описание
Conquer Multithreading in C# with understanding Race Conditions, Lock & Monitor.
Ever wonder how to tame wild threads in C#? This video dives DEEP into multithreading, unraveling the mysteries of race conditions ️ and showing you how to achieve perfect harmony with the lock keyword and the powerful Monitor class.

We'll crack open the hood and explore the INTERNAL workings of these synchronization beasts, giving you the ultimate edge in building rock-solid, multithreaded applications.

Here's what you'll master:

Race Conditions Demystified: Uncover the gremlins lurking in your code that can cause unpredictable behavior.
The lock Keyword: Learn the secret handshake that ensures only one thread accesses a shared resource at a time.
The Monitor Class Unveiled: Peer behind the curtain to see how the lock keyword works its magic under the hood.
**Whether you're a seasoned C# developer or just starting your multithreading journey, this video will equip you with the knowledge to write clean, concurrent code with confidence! **

Timeline:
0:00 - Task synchronization
0:30 - understanding race condition
02:50 - Race condition in C# visually
05:25 - Introduction to lock in C#
08:00 - lock internals
10:00 - lock best practices
14:36 - Monitor class internals
#csharp #multithreading #raceconditions #lock #monitor #concurrency #programming
Рекомендации по теме
Комментарии
Автор

Thanks! Great series on concurency. And "Like a senior" series is a best seller, very few advanced and easy to understand tutorials like this out there

vladm
Автор

You didn't show "the internals" of Monitor, just 2 public apis, the internals would be the WaitHandle and others. Not that I think this is important to understand, but anyway... Also I think the biggest miss is that this is trying to use WaitHandle locks with Tasks, which may work but isn't recommended. This would be more important with thread-safety in a non async/task environment, which is a very niche case. This case with a Task, is the more common one, but the better way to handle it would be to use an async method for the work, and inside use a SemaphoreSlim.

dusrdev
welcome to shbcf.ru