what should not be done to avoid deadlock
How To Avoid Deadlock
Avoid Nested Locks: A deadlock mainly happens when we give locks to multiple threads. Avoid giving a lock to multiple threads if we already have given to one.Avoid Unnecessary Locks: We can have a lock only those members which are required. Using Thread.
What is a deadlock and what will you do to avoid deadlocks? Nothing can change, so this is a permanent blocking of the threads, and a deadlock.
[Read More]