What does the Java Memory Model ensure regarding thread interaction?
The JMM prevents multiple threads from reading and writing to the same memory location simultaneously.
Thatâ€™s incorrect. The JMM doesnâ€™t automatically prevent simultaneous reads and writes; synchronization and other techniques handle that.
Can you describe how the JMM handles synchronization to ensure thread-safe access to shared data?