Text version of the video
http://csharp-video-tutorials.blogspot.com/2014/03/part-95-deadlock-in-multithreaded_19.html
Healthy diet is very important both for the body and mind. If you like Aarvi Kitchen recipes, please support by sharing, subscribing and liking our YouTube channel. Hope you can help.
https://www.youtube.com/channel/UC7sEwIXM_YfAMyonQCrGfWA/?sub_confirmation=1
Slides
http://csharp-video-tutorials.blogspot.com/2014/03/part-95-deadlock-in-multithreaded.html
All C# Text Articles
http://csharp-video-tutorials.blogspot.com/p/free-c-video-tutorial-for-beginners.html
All C# Slides
http://csharp-video-tutorials.blogspot.com/p/c.html
All Dot Net and SQL Server Tutorials in English
https://www.youtube.com/user/kudvenkat/playlists?view=1&sort=dd
All Dot Net and SQL Server Tutorials in Arabic
https://www.youtube.com/c/KudvenkatArabic/playlists
In this video we will discuss, why and how a deadlock can occur in multithreading with an example.
Scenario when a deadlock can occur
Let's say we have 2 threads
a) Thread 1
b) Thread 2
and 2 resources
a) Resource 1
b) Resource 2
Thread 1 has already acquired a lock on Resource 1 and wants to acquire a lock on Resource 2. At the same time Thread 2 has already acquired a lock on Resource 2 and wants to acquire a lock on Resource 1. Two threads never give up their locks, hence a deadlock.