In a multithreaded environment, managing the shared data is a challenging activity. This is because multiple threads may try to perform the reading and writing operations simultaneously. If you do not coordinate them, you may see erroneous outcomes. Synchronization mechanisms help you control access to shared data to avoid inconsistent or erroneous outcomes.
This chapter discusses some useful synchronization ...