Java / Java Multithreading
What is Intrinsic Lock in Java multithreading?
Synchronization is internally controlled by an entity known as the intrinsic lock or monitor lock. Intrinsic locks play a role in both aspects of synchronization: enforcing exclusive access to an object's state to one thread and preventing access to other threads and establishing happens-before relationships that are essential to visibility.
Every object has an associated intrinsic lock. A thread that needs exclusive and consistent access to an object's fields has to acquire the object's intrinsic lock before accessing them, and then release the intrinsic lock when done.As long as a thread owns an intrinsic lock, no other thread can acquire the same lock, the other thread will block.
More Related questions...