(In case of single CPU ) for understanding volatile -I know volatile forces thread to use main memory and will not keep copy in its local memory.
In one of the StackOverFlow post I see that java threads uses CPU cache and using volatile it will force to use main memory
Thread Caching and Java Memory model.
If this is the case then there should not be issue with memory visibility, since one thread can see values written by other thread (assuming on single CORE CPU we will have single cache). so volatile is usefule for single CPU?