锁定分裂与锁定条带化 [英] Lock splitting vs lock striping

查看:145
本文介绍了锁定分裂与锁定条带化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以下是Joshua的Effective Java摘录:

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.

锁定条带化是关于为类管理的数据结构的不同部分(条带)使用不同的锁定;例如将地图划分为子地图,每个地图都有自己的锁。

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.

这篇关于锁定分裂与锁定条带化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆