Lock splitting vs lock striping

社会主义新天地 提交于 2019-12-22 04:07:46

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/44123180/lock-splitting-vs-lock-striping

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!