volatile is a special modifier, which can only be used with instance variables. In concurrent Java programs, changes made by multiple threads on instance variables is not visible to other in absence of any synchronizers e.g. synchronized keyword or locks. Volatile variable guarantees that a write will happen before any subsequent read, as stated "volatile variable rule" in previous question.
Subscribe to:
Post Comments
(
Atom
)
No Comment to " What is volatile variable in Java? "