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?
Lock splitting is about using different locks for different parts of a classes functionality; e.g. one lock for read operations and another one for write operations.
Conceptually, lock striping is the technique of dividing a lock into many stripes, increasing the granularity of a single lock and allowing independent operations to lock different stripes and proceed concurrently, instead of creating contention for a single lock.
Lock splitting is about using different locks for different parts of a classes functionality; e.g. one lock for read operations and another one for write operations.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With