Question about object lock

Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Nov 2004
Posts: 189
Reputation: George2 is an unknown quantity at this point 
Solved Threads: 0
George2 George2 is offline Offline
Junior Poster

Question about object lock

 
0
  #1
Feb 1st, 2005
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
Reply With Quote Quick reply to this message  
Join Date: Nov 2004
Posts: 6,143
Reputation: jwenting is just really nice jwenting is just really nice jwenting is just really nice jwenting is just really nice 
Solved Threads: 212
Team Colleague
jwenting's Avatar
jwenting jwenting is offline Offline
duckman

Re: Question about object lock

 
0
  #2
Feb 1st, 2005
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
Reply With Quote Quick reply to this message  
Join Date: Nov 2004
Posts: 189
Reputation: George2 is an unknown quantity at this point 
Solved Threads: 0
George2 George2 is offline Offline
Junior Poster

Re: Question about object lock

 
0
  #3
Feb 1st, 2005
Thanks jwenting,


Originally Posted by 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
Reply With Quote Quick reply to this message  
Join Date: Nov 2004
Posts: 189
Reputation: George2 is an unknown quantity at this point 
Solved Threads: 0
George2 George2 is offline Offline
Junior Poster

Re: Question about object lock

 
0
  #4
Feb 5th, 2005
Thanks for all the people who helped me on this thread.


regards,
George
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Java Forum


Views: 4565 | Replies: 3
Thread Tools Search this Thread



Tag cloud for Java
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC