If a class has two synchronized functions, a thread enters one of the synchronized function, then is it possible for another thread to enter the second synchronized function?

Showing Answers 1 - 2 of 2 Answers

Deepthik

  • Apr 13th, 2006
 

                     The thread can enter into the other synchroised methods if the other method is static snychoreised method while the first method is non static synchronised method. because in order to enter into the snychroinsed method the thread should acquire a lock. if it is a static snychronised method then the thread requires a class level lock else it requires a instance level lock.

  Was this answer useful?  Yes

           In java, once a thread is inside a synchronized method/block , no other thread can call any other synchronized method/block on the same object.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions