What does synchronization do?
Synchronization has several aspects. The most well-understood is mutual exclusion — only one thread can hold a monitor at once, so synchronizing on a monitor means that once one thread enters a synchronized block protected by a monitor, no other thread can enter a block protected by that monitor until the first thread exits the synchronized block. But there is more to synchronization than mutual exclusion. Synchronization ensures that memory writes by a thread before or during a synchronized block are made visible in a predictable manner to other threads which synchronize on the same monitor. After we exit a synchronized block, we release the monitor, which has the effect of flushing the cache to main memory, so that writes made by this thread can be visible to other threads. Before we can enter a synchronized block, we acquire the monitor, which has the effect of invalidating the local processor cache so that variables will be reloaded from main memory. We will then be able to see al
Related Questions
- After SalesDesktop first synchronization I got duplicates for all my business contacts. What is the reason for this, and how can this problem be solved?
- What is the difference between the "Bi-directional Sync" setting option and "Upload Only" setting option for media file synchronization?
- Does cGMP Have Other Effects on Mechanisms Important for Synchronization?