0

Hello everyone,


I want to know which method owns the lock of a specific object (some of my methods are blocked because they can not achieve the lock of a specific object, and I am wondering which method owns the lock to solve the deadlock issue). Does anyone know how to get the information?


Thanks in advance,
George

2
Contributors
3
Replies
4
Views
12 Years
Discussion Span
Last Post by George2
0

The object that first uses the object in synchronised code owns the lock.
There's no easy way to find out what that is, you'll need to diagnose your code to figure out in what places objects are used in a concurrent way and then figure out a means to deconflict them.

Better of course is to design your code from the start to make deadlock impossible ;)

0

Thanks jwenting,

The object that first uses the object in synchronised code owns the lock.
There's no easy way to find out what that is, you'll need to diagnose your code to figure out in what places objects are used in a concurrent way and then figure out a means to deconflict them.

Better of course is to design your code from the start to make deadlock impossible ;)

Your reply is very helpful. I think you a very experienced developer from your reply. Can you provide me more detailed skills/tricks dealing with how to find out deadlocks?


regards,
George

0

Thanks for all the people who helped me on this thread.


regards,
George

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.