With a class that has synchronized methods, we know that when a thread enters such methods, it updates its cache with the object state from main memory, and when it leaves such methods, it writes its changes to the object state in main memory.
However, in the absence of synchronized methods, will a thread ever go to main memory to get that object's state (except of course for the very first time), or write the changed state back to memory? If yes, under what conditions?
One obvious thought that comes to mind is when the cache is 'full' and dirty, the thread will have to flush it to main memory before reading in more data, or if the cache is invalidated, it will have to discard it and get latest data from main memory. Is this correct? Are there any other conditions under which such 'automatic' memory synchronization will occur?
volatilereferences almost certainly qualify as an answer here.