Uncategorized

Lock striping vs Lock splitting

Lock stripping: Use different locks for different purposes on the whole data structure. For example, a read lock + a write lock Lock splitting: Use multiple locks for different parts of a data structure. For example, 16 locks are used for a ConcurrentHashMap, each guards N/16 buckets (N = total number of buckets)