Shared Tutorials

Tutorials Shared by the Internet Community

Advertisements

  Top Tutorials     New Tutorials     Submit     Login     Register  

Tutorial Basic Detail

How to check if a thread holds lock on a particular obj

Think about a scenario where you would have to find at run time that whether a thread has lock on a particular object e.g. find out whether thread New
http://javarevisited.blogspot.com/2010/10/how-to-check-if-thread-has-lock-on.html

Description:

Think about a scenario where you would have to find at run time that whether a thread has lock on a particular object e.g. find out whether thread NewsReader has lock on NewsPaper object or not ?

If this questions came in any interview then I would automatically assume that there could be at least two answer one is hard earned raw answer which programmer would like to figure out based on fundamentals and other could be some rarely used API calls which is available in java , by the way this is actually asked to me in an interview of one of the biggest global bank.

Rating Detail

 Stars  Percentage  Total Vote
 One star  Vote LeftVote MiddleVote Right 38.85%  54
 Two starsTwo star  Vote LeftVote MiddleVote Right 10.07%  14
 Three starsThree starsThree stars  Vote LeftVote MiddleVote Right 11.51%  16
 Four starsFour starsFour starsFour stars  Vote LeftVote MiddleVote Right 10.79%  15
 Five starsFive starsFive starsFive starsFive stars  Vote LeftVote MiddleVote Right 28.78%  40

Caste Your Vote

 Rating  Selection  Guidelines
 Poor:     Very disappointing, useless.
 Fair:     Below average, disappointing but not useless.
 Good:     About average in its class.
 Very Good:     Above average for its category.
 Excellent:     One of the best Tutorials in its category.





Advertisements