// Every read of a volatile variable will be read from RAM, not from cache (usually variables are cached for performance reasons) // Caches are faster -> do not use volatile kw if not necessary. // If ...
// 1. volatile variables can't be put inside functions. // 2. if a volatile variable is passed to a function, it no longer remains volatile. To pass a volatile variable // pass its owning class object ...