First, the volatile keyword is for more than just requesting that no caching takes place with registers and the L1/L2 caches. It also (a) preserves ordering. The compiler or JIT compiler will not reorder the instructions (code motion type optimizations). It also (b) guarantee the atomic nature of all variable sets and gets -- meaning setting and getting longs and doubles will be guaranteed to be atomic.
Second, how likely is it for your
java code to be running on a single core system. These days, (c) even entry level computers have more than one core. Can you really assume that it will be running on a single core systems. And... (d) I think register caching may be an issue. While I do believe that the hardware caches are flushed during a context switch, I don't think this is true for registers. Instead, I believe registers are merely saved, to be restored back on the context switch back.
Henry