About
Concurrency - Synchronization in java.
Java offers two basic synchronization idioms:
- final fields, which cannot be modified after the object is constructed, can be safely read through non-synchronized methods, once the object is constructed.
- Atomic Access does not require synchronization
The Java programming language neither prevents nor requires detection of deadlock conditions.
Articles Related
Idioms
To create synchronized code (ie which gives consistent values) between threads, you use the synchronized word..
Method
- Java Concurrency - Synchronized method: If an object is visible to more than one thread, all reads or writes to that object's variables must be done through synchronized methods.
Statement
Implementation
Synchronization is implemented by an internal entity known as the monitor (intrinsic lock or monitor lock).