*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes synchronized methods Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "synchronized methods" Watch "synchronized methods" New topic
Author

synchronized methods

Sasikanth Malladi
Ranch Hand

Joined: Nov 04, 2000
Posts: 175
All, if a synchronized method calls a non synchronized one, I think the guarantee of only thread accessing the method won't extend to the non-synchronized one. Am I right?
TIA,
Sashi
Keith Lynn
Ranch Hand

Joined: Feb 07, 2005
Posts: 2367
There are scenarios where you could have multiple threads access the unsynchronized methods, but no other thread would use the unsynchronized method from within the synchronized method until it obtained a lock on the object.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: synchronized methods
 
Similar Threads
ambiguity in Master Exam option
ENLIGHTENING, thread synchronization, concept clarification --plz help
call non-synchronized method within synchronized method (or) synchronized block?
Synchronized calling non-synchronized
Thread behavior with synchronized method