-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating

Java 9 Concurrency Cookbook, Second Edition
By :

In Chapter 2, Basic Thread Synchronization, you learned the concepts of synchronization and critical sections. Basically, we talk about synchronization when more than one concurrent task shares a resource, for example, an object or an attribute of an object. The blocks of code that access this shared resource are called critical sections.
If you don't use appropriate mechanisms, you might have incorrect results, data inconsistencies, or error conditions. Therefore, we have to adopt one of the synchronization mechanisms provided by the Java language to avoid these problems.
Chapter 2, Basic Thread Synchronization, taught you about the following basic synchronization mechanisms:
synchronized
keywordReentrantLock
, ReentrantReadWriteLock.ReadLock
, and ReentrantReadWriteLock.WriteLock
StampedLock
classIn this chapter, you will learn how to use high-level mechanisms to synchronize multiple threads. These high-level mechanisms...