Hi all, I came across this good article on how JVM implements synchronization behind the hood. web page. Hope this will help other certification aspirants like me. Ramnath Modified title to be more specific... [ April 10, 2004: Message edited by: Barry Gaunt ]
It is a great article to certain extent. It gives similar explanation as some books with respect to accessing a synchronized method. After reading the article, I still have the question:"When there is a synchronized method in the object and a thread gets a lock, is the lock on the whole object or just the method??"
After reading the article, I still have the question:"When there is a synchronized method in the object and a thread gets a lock, is the lock on the whole object or just the method??"
The whole object but non synchronized metods can be accessed by multiple threads.
hey kishore this might not be the correct answer but i think it is, well every object has synchronized methods and methods which are not synchronized for which a thread don't need a lock so a thread can enter an object and run those methods but not the synchronized method until other thread give up the lock. I hope ur question is answered.
Joel Salatin has signs on his property that say "Trespassers will be Impressed!" Impressive tiny ad:
a bit of art, as a gift, the permaculture playing cards