摘要:
单实例的正确实现方式 获取锁的正确操作为: SET resource_name my_random_value NX PX 30000,它限定了只有当锁空闲且持有锁的时间为30000ms,并且锁资源对应的 value 为一个随机值。设置随机值是为了在释放锁时,确保当前线程能够释放该锁,避免出现操作超 阅读全文
posted @ 2023-09-03 20:41
Stitches
阅读(65)
评论(0)
推荐(0)
摘要:
# 时间轮算法介绍 _时间轮算法.assets/20230901215825.png) `HashedWheelTimer` 定时轮算法在 netty、dubbo 等框架中运用广泛。比如在 Dubbo 中为了增强系统的容错能力,会有相应的监听判断机制比如 阅读全文
posted @ 2023-09-03 20:39
Stitches
阅读(309)
评论(0)
推荐(0)
摘要:
参考 https://www.zhihu.com/question/41918492/answer/490367825 线程模型 Quartz 的线程模型如上图所示,其中 RegularSchedulerThread 为常规调度线程、MisfireSchedulerThread 为错失触发调度线程、 阅读全文
posted @ 2023-09-03 20:36
Stitches
阅读(677)
评论(0)
推荐(0)
摘要:
参考: https://juejin.cn/post/7216679822097252411?searchId=20230726145213061AD6F989D36601FB8B https://www.jianshu.com/p/b94ebb8780fa https://www.cnblogs. 阅读全文
posted @ 2023-09-03 20:36
Stitches
阅读(96)
评论(0)
推荐(0)