Explain about thread synchronization inside a monitor?



Explain about thread synchronization inside a monitor?..

Answer / Mudit Kumar Gupta

Thread synchronization inside a monitor (also known as synchronized blocks) ensures that only one thread can execute a block of code at a time. In Java, when a thread enters a synchronized block for an object, it acquires a lock on the object. Other threads attempting to enter the same synchronized block will be blocked until the first thread exits the block and releases the lock.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Advanced Java Interview Questions

What are the different algorithms used for clustering?

1 Answers  


what is default length of textfield ?

1 Answers  


int x=5,i=1,y=0; while(i<=5) { y=x++ + ++x; i=i+2; } System.out.println(x); System.out.println(y); System.out.println(i); How to solve this? Please explain!

1 Answers  


Have you used threads in Servelet?

1 Answers   Satyam,


On a computer that having single CPU, how multithreading concept can be achieved?

1 Answers   Zensar,


difference between applicationserver and webserver

2 Answers   SolutionNET,


difference between HashMap, Hashset and hashTable?

2 Answers   HCL, Infotech,


What is RMI architecture?

11 Answers   Infosys,


What is an abstract method?

1 Answers  


what is activation monitor and what is its job?

1 Answers  


What is a sessionfactory? Is it a thread-safe object?

1 Answers  


What is an applet?

5 Answers  


Categories