ReadWriteLock in Java

A ReadWriteLock interface is more sophisticated than the Lock interface. Imagine you have an application that reads from and writes to some resource, but reading frequency is much more higher than writing frequency. Two or more threads reading the same resource do not cause any problem for each other, i.e., multiple threads reading the same […]

Read More

Lock in Java

We are already aware of basic concepts around thread synchronization and various mechanisms using synchronized keyword. A lock interface is a thread synchronization aid like synchronized block except lock can be used in a more sophisticated way than Java’s synchronized blocks. A lock is a tool for controlling access to a shared resource by multiple […]

Read More