...
- A write to a variable does not depend on its current value
- The write is not involved with writes of other variables
- There is no need to synchronize the code to access the variable
Wiki Markup |
---|
Variables should be declared as {{volatile}} when this criteria is met \[[Goetz 06|AA. Java References#Goetz 06]\]. If this is not done, multiple threads may observe stale values of the shared variables and fail to act accordingly. |
...