RedisLockExecutorImpl 获取锁的实现,可不用作缓存
ihenjoy opened this issue · 2 comments
ihenjoy commented
HaojunRen commented
如果不做缓存,Redission每次去获取锁,都会new Redission Lock对象,对于吞吐量很大的服务,一秒几千上万次调用,那岂不是一秒也要创建出成千上万个对象出来?数据应该都正确的,重入锁应该需要重复利用,缓存起来吧?
HaojunRen commented
参考源码,每次getLock都是new RedissonLock
public class Redisson implements RedissonClient {
...
@Override
public RLock getLock(String name) {
return new RedissonLock(commandExecutor, name);
}
...
}