pjj pjj - 1 year ago 107
Java Question

Lock splitting vs lock striping

Below is the excerpt from Effective Java by Joshua:


If you do synchronize your class internally, you can use various
techniques to achieve high concurrency, such as lock splitting, lock
striping, and nonblocking concurrency control.


Above suggests that lock splitting and lock striping are 2 different techniques but when I tried to find the difference between I couldn't find a difference.

Is there is a difference between them or they are same thing?

Answer Source

Lock splitting is about using different locks for a different part of a classes functionality; e.g. one lock for reads and another for writes.

Lock striping is about using different locks for different parts (stripes) of the data structure that a class manages; e.g. dividing a map into submaps, each with their own locks.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download