Thread Synchronization in Java

When two or more threads try to access the same resource, they need somehow to ensure that the resource will be used by only one thread at a time. The process by which this achive is called Synchronization. Java uses the concept of monitor (also called semaphore) for Synchronization. The monitor allows one thread at … Read more