Separation lock and split lock
Split locks can sometimes be expanded into a collection of locking blocks, and they belong to separate objects, which is the separation of locks.
If a lock protects multiple independent state variables, you may be able to improve the scalability by splitting the locks so that each lock protects the different variables. With such a change, the frequency of each lock is made smaller. Split Locks Locks for medium-intensity competition can effectively convert most of them into non-competitive locks, improving performance and scalability.
Another way to reduce lock competition is to reduce the frequency of thread request locks. Lock splitting and lock striping are two ways to achieve this. Independent state variables should be protected using a separate lock. Sometimes the developer will incorrectly use a lock to protect all state variables. These techniques reduce the granularity of the lock and achieve better scalability. However, these locks need to be carefully assigned to reduce the risk of deadlocks.