| Author |
Good link (Threads)
|
Ramnath krishnamurthi
Ranch Hand
Joined: Jan 22, 2003
Posts: 56
|
|
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 ]
|
 |
Kishore Dandu
Ranch Hand
Joined: Jul 10, 2001
Posts: 1934
|
|
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??"
|
Kishore
SCJP, blog
|
 |
Pradeep bhatt
Ranch Hand
Joined: Feb 27, 2002
Posts: 8876
|
|
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.
|
Groovy
|
 |
Kishore Dandu
Ranch Hand
Joined: Jul 10, 2001
Posts: 1934
|
|
|
If the whole object is locked by the thread, how are other threads entering other methods. beats me!!
|
 |
shaggy lype
Greenhorn
Joined: Apr 02, 2004
Posts: 21
|
|
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.
|
 |
 |
|
|
subject: Good link (Threads)
|
|
|