Knowledge Management Banner

Knowledge Management Banner

C#: Deadlock : Part 31

What is DeadLock ?

Thread T1 has acquired resource R1 and wants to acquire Resource R2, but Thread T2 has already acquired resource R2 and now wants to acquire resource R1, Which is already acquired by T1.
This results in Deadlock.

How to avoid deadlock.

  • Acquiring lock on specific defined order
  • Mutex class
  • Monitor.TryEnter


No comments

Powered by Blogger.