Volatile
You can declare that a member variable is modified
If your class contains a member variable that is modified asynchronously
by concurrently running threads, you can use Java's volatile
keyword to notify the Java runtime system of this.
At this time, the Java runtime system ignores the volatile marker.
However, future releases of the Java runtime system will use this
information to ensure that the variable is loaded from memory before each use,
and stored to memory after each use to ensure that the value of the variable
is consistent and coherent within each thread.