Thread synchronization in java

Synchronization is the process of synchronizing the threads’ access to a shared resource. We know that threads run randomly depending on the thread scheduler implementation. In certain situations, when multiple threads access a shared resource (object), then they work upon it simultaneously. This situation might result in a erroneous output. Let’s take an example of … Continue reading Thread synchronization in java