The JVM is guaranteed to treat reads and writes of data of 32 bits or less as atomic. For long or double variable, programmers should take care in multi-threading environment. Either put these variables in a synchronized method or block, or declare them volatile. http://www.vaathsalya.com
reply or leave comment
|
|
|
|