You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Write a Java code where a resource is accessed by multiple threads. You need to write code in such a way that no deadlock should occur.
Hint: The trick to solve this problem is acquiring resources in order and release them in reverse order, e.g. first acquire resource R1 and only if you have got R1 to go for R2. This way, you can avoid deadlock.
The text was updated successfully, but these errors were encountered:
Write a Java code where a resource is accessed by multiple threads. You need to write code in such a way that no deadlock should occur.
Hint: The trick to solve this problem is acquiring resources in order and release them in reverse order, e.g. first acquire resource R1 and only if you have got R1 to go for R2. This way, you can avoid deadlock.
The text was updated successfully, but these errors were encountered: