We use volatile in one of our projects to maintain the same copy of variable accessed by different threads. My question is whether it is alright to use vo
Small elaboration, but the volatile keyword isn't just for for memory visibility. Before Java ver 1.5 was released the volatile keyword declared that the field will get the most recent value of the object by hitting main memory each time for reads and flushing for writes.
In the latest Java versions, the volatile keyword says two very important things:
Check it out for more Java volatile examples.