Java's happens-before and synchronization
问题 I'm having a little disagreement on Java's happens-before and synchronization. Imagine the following scenario: Main Thread MyObject o = new MyObject(); // (0) synchronized (sharedMonitor) { // (1) add the object to a shared collection } // (2) spawn other threads Other Threads MyObject o; synchronized (sharedMonitor) { // (3) retrieve the previously added object } // (4) actions to modify the object Note that the instance variables of MyObject aren't neither volatile , nor final . The methods