volatile
The volatile keyword in Java
Today I met this code
class someClass {
// ...
private volatile int a;
// ...
}
The question is, what is volatile in this context?
Volatile and CPU caches
Hello, here is such a question. As far as I understand, Volatile variables are required to be permanently written to memory. ... But if on one core, then the cache is one and all threads write there, then the meaning of volatile? Or I don't get it right.
Application and meaning of the volatile keyword
If you read the much-loved msdn, you can find the following wording:
The volatile keyword indicates that the field can b ... ch gives me the right at any time, regardless of whether it has changed or not, to get the really correct value of the field.