分布式锁定有限的过程可以使用
我正在寻找一个具有类似功能的分布式锁定框架,只有有限的过程才能使用此锁。
例如:
Lock lock =new Lock("key", 5);
只有5个进程可以同时使用此锁,其他过程必须等到其中一个锁完成工作。
您知道那种框架还是如何用现有的框架实施一个框架?
I am looking for a distributed lock framework that has a feature like, only limited number of process can use this lock.
For example:
Lock lock =new Lock("key", 5);
Only 5 process can use this lock at the same time, others has to wait until one of them finishes its job.
Do you know that kind of a framework or how can I implement one with existing ones ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为您正在寻找 semaphore 。大多数主要的Redis和Hazelcast客户都已经实施了这一点。例如,在Java中,您有:
https://redisson.org/redisson.org/glosson.org/glossary/java-semaphore/java-semaphore-java-semaphore-java-semaphore 。
4.2/数据结构/isemaphore
I think you are looking for a Semaphore. Most major Redis and Hazelcast clients have already implemented this. For example, in Java, you have:
https://redisson.org/glossary/java-semaphore.html
https://docs.hazelcast.com/imdg/4.2/data-structures/isemaphore